opennebula-cli 6.0.0.3 → 6.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/oneacct +2 -13
- data/bin/oneacl +2 -13
- data/bin/onecluster +2 -13
- data/bin/onedatastore +2 -13
- data/bin/oneflow +2 -13
- data/bin/oneflow-template +2 -13
- data/bin/onegroup +2 -13
- data/bin/onehook +6 -17
- data/bin/onehost +2 -13
- data/bin/oneimage +6 -17
- data/bin/onemarket +2 -13
- data/bin/onemarketapp +10 -21
- data/bin/onesecgroup +2 -13
- data/bin/oneshowback +2 -13
- data/bin/onetemplate +8 -28
- data/bin/oneuser +2 -13
- data/bin/onevcenter +3 -14
- data/bin/onevdc +2 -13
- data/bin/onevm +18 -180
- data/bin/onevmgroup +6 -17
- data/bin/onevnet +6 -17
- data/bin/onevntemplate +6 -17
- data/bin/onevrouter +6 -17
- data/bin/onezone +3 -14
- data/lib/one_helper/onecluster_helper.rb +42 -75
- data/lib/one_helper/onevm_helper.rb +0 -20
- data/lib/one_helper/onevnet_helper.rb +151 -173
- data/lib/one_helper/onezone_helper.rb +4 -12
- data/lib/one_helper.rb +2 -2
- data/share/schemas/xsd/opennebula_configuration.xsd +0 -1
- data/share/schemas/xsd/vnet.xsd +0 -2
- metadata +32 -32
data/bin/onevm
CHANGED
@@ -26,25 +26,14 @@ else
|
|
26
26
|
GEMS_LOCATION = ONE_LOCATION + '/share/gems'
|
27
27
|
end
|
28
28
|
|
29
|
-
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
29
|
if File.directory?(GEMS_LOCATION)
|
31
30
|
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
31
|
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
32
|
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
33
|
+
require 'rubygems'
|
34
|
+
Gem.use_paths(real_gems_path)
|
45
35
|
end
|
46
36
|
end
|
47
|
-
# %%RUBYGEMS_SETUP_END%%
|
48
37
|
|
49
38
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
50
39
|
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
@@ -218,27 +207,6 @@ CommandParser::CmdParser.new(ARGV) do
|
|
218
207
|
:description => 'Market to save oneshot'
|
219
208
|
}
|
220
209
|
|
221
|
-
NIC_ID = {
|
222
|
-
:name => 'nic_id',
|
223
|
-
:large => '--nic-id nic_id',
|
224
|
-
:format => String,
|
225
|
-
:description => 'NIC to use when SSH'
|
226
|
-
}
|
227
|
-
|
228
|
-
CMD = {
|
229
|
-
:name => 'cmd',
|
230
|
-
:large => '--cmd cmd',
|
231
|
-
:format => String,
|
232
|
-
:description => 'CMD to run when SSH'
|
233
|
-
}
|
234
|
-
|
235
|
-
SSH_OPTS = {
|
236
|
-
:name => 'ssh_opts',
|
237
|
-
:large => '--ssh-options options',
|
238
|
-
:format => String,
|
239
|
-
:description => 'SSH options to use'
|
240
|
-
}
|
241
|
-
|
242
210
|
########################################################################
|
243
211
|
# Global Options
|
244
212
|
########################################################################
|
@@ -1342,9 +1310,9 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1342
1310
|
Valid states are: All.
|
1343
1311
|
EOT
|
1344
1312
|
|
1345
|
-
command :lock, lock_desc,
|
1313
|
+
command :lock, lock_desc, :vmid,
|
1346
1314
|
:options => [USE, MANAGE, ADMIN, ALL] do
|
1347
|
-
helper.
|
1315
|
+
helper.perform_action(args[0], options, 'VM locked') do |vm|
|
1348
1316
|
if !options[:use].nil?
|
1349
1317
|
level = 1
|
1350
1318
|
elsif !options[:manage].nil?
|
@@ -1365,8 +1333,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1365
1333
|
Valid states are: All.
|
1366
1334
|
EOT
|
1367
1335
|
|
1368
|
-
command :unlock, unlock_desc,
|
1369
|
-
helper.
|
1336
|
+
command :unlock, unlock_desc, :vmid do
|
1337
|
+
helper.perform_action(args[0], options, 'VM unlocked') do |vm|
|
1370
1338
|
vm.unlock
|
1371
1339
|
end
|
1372
1340
|
end
|
@@ -1379,7 +1347,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1379
1347
|
You can configure the actions in /etc/one/cli/onevm.yaml
|
1380
1348
|
EOT
|
1381
1349
|
|
1382
|
-
command :'create-chart', create_chart_desc, :
|
1350
|
+
command :'create-chart', create_chart_desc, [:range, :vmid_list] do
|
1383
1351
|
charters = helper.get_charters
|
1384
1352
|
|
1385
1353
|
if charters.nil?
|
@@ -1393,7 +1361,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1393
1361
|
charters.each do |action, time|
|
1394
1362
|
sched = "+#{time[:time].to_i + acc_t}"
|
1395
1363
|
|
1396
|
-
helper.schedule_actions(
|
1364
|
+
helper.schedule_actions(args[0],
|
1397
1365
|
{ :schedule => sched },
|
1398
1366
|
action.to_s,
|
1399
1367
|
time[:warning][:time] + acc_w)
|
@@ -1469,33 +1437,25 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1469
1437
|
helper.perform_action(args[0], options, 'Backup') do |vm|
|
1470
1438
|
vm.extend(OpenNebula::VirtualMachineExt)
|
1471
1439
|
|
1472
|
-
#
|
1473
|
-
|
1474
|
-
log_to = STDOUT
|
1475
|
-
elsif !options[:logger].nil?
|
1476
|
-
log_to = options[:logger]
|
1477
|
-
end
|
1478
|
-
|
1479
|
-
keep = options.key?(:keep)
|
1440
|
+
# If logger is specified use it, if not use STDOUT
|
1441
|
+
options[:logger].nil? ? log_to = STDOUT : log_to = options[:logger]
|
1480
1442
|
|
1481
|
-
|
1482
|
-
|
1483
|
-
|
1443
|
+
# Read user options
|
1444
|
+
keep = options.key?(:keep)
|
1445
|
+
logger = Logger.new(log_to)
|
1446
|
+
format = '%Y-%m-%d %H:%M:%S'
|
1484
1447
|
|
1485
|
-
|
1486
|
-
|
1487
|
-
"#{severity.ljust(5)} : #{msg}\n"
|
1488
|
-
end
|
1448
|
+
logger.formatter = proc do |severity, datetime, _p, msg|
|
1449
|
+
"#{datetime.strftime(format)} #{severity.ljust(5)} : #{msg}\n"
|
1489
1450
|
end
|
1490
1451
|
|
1491
|
-
binfo = {}
|
1492
|
-
binfo[:market] = options[:market]
|
1493
|
-
|
1494
1452
|
if options.key?(:oneshot)
|
1453
|
+
binfo = {}
|
1495
1454
|
binfo[:name] = "VM #{vm.id} BACKUP - " \
|
1496
1455
|
"#{Time.now.strftime('%Y%m%d_%k%M')}"
|
1497
1456
|
binfo[:freq] = 1
|
1498
1457
|
binfo[:last] = Time.now.to_i - 100
|
1458
|
+
binfo[:market] = options[:market]
|
1499
1459
|
end
|
1500
1460
|
|
1501
1461
|
begin
|
@@ -1558,128 +1518,6 @@ CommandParser::CmdParser.new(ARGV) do
|
|
1558
1518
|
end
|
1559
1519
|
end
|
1560
1520
|
|
1561
|
-
ssh_desc = <<-EOT.unindent
|
1562
|
-
SSH into VM
|
1563
|
-
|
1564
|
-
Options example:
|
1565
|
-
|
1566
|
-
'-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null'
|
1567
|
-
EOT
|
1568
|
-
|
1569
|
-
command :ssh,
|
1570
|
-
ssh_desc,
|
1571
|
-
:vmid,
|
1572
|
-
[:login, nil],
|
1573
|
-
:options => [NIC_ID, CMD, SSH_OPTS] do
|
1574
|
-
helper.perform_action(args[0], options, 'SSH') do |vm|
|
1575
|
-
rc = vm.info
|
1576
|
-
|
1577
|
-
if OpenNebula.is_error?(rc)
|
1578
|
-
STDERR.puts rc.message
|
1579
|
-
exit(-1)
|
1580
|
-
end
|
1581
|
-
|
1582
|
-
# Get user to login
|
1583
|
-
args[1].nil? ? login = 'root' : login = args[1]
|
1584
|
-
|
1585
|
-
# Get CMD to run
|
1586
|
-
options[:cmd].nil? ? cmd = '' : cmd = options[:cmd]
|
1587
|
-
|
1588
|
-
# Get NIC to connect
|
1589
|
-
if options[:nic_id]
|
1590
|
-
nic = vm.retrieve_xmlelements(
|
1591
|
-
"//TEMPLATE/NIC[NIC_ID=\"#{options[:nic_id]}\"]"
|
1592
|
-
)[0]
|
1593
|
-
else
|
1594
|
-
nic = vm.retrieve_xmlelements('//TEMPLATE/NIC[SSH="YES"]')[0]
|
1595
|
-
end
|
1596
|
-
|
1597
|
-
nic = vm.retrieve_xmlelements('//TEMPLATE/NIC[1]')[0] if nic.nil?
|
1598
|
-
|
1599
|
-
if nic.nil?
|
1600
|
-
STDERR.puts 'No NIC found'
|
1601
|
-
exit(-1)
|
1602
|
-
end
|
1603
|
-
|
1604
|
-
# If there is node port
|
1605
|
-
if nic['EXTERNAL_PORT_RANGE']
|
1606
|
-
ip = vm.to_hash['VM']['HISTORY_RECORDS']['HISTORY']
|
1607
|
-
ip = [ip].flatten[-1]['HOSTNAME']
|
1608
|
-
port = Integer(nic['EXTERNAL_PORT_RANGE'].split(':')[0]) + 21
|
1609
|
-
else
|
1610
|
-
ip = nic['IP']
|
1611
|
-
port = 22
|
1612
|
-
end
|
1613
|
-
|
1614
|
-
options[:ssh_opts].nil? ? opts = '' : opts = options[:ssh_opts]
|
1615
|
-
|
1616
|
-
system("ssh #{opts} #{login}@#{ip} -p #{port} #{cmd}")
|
1617
|
-
end
|
1618
|
-
|
1619
|
-
$?.exitstatus
|
1620
|
-
end
|
1621
|
-
|
1622
|
-
port_desc = <<-EOT.unindent
|
1623
|
-
Get port forwarding from a NIC, e.g:
|
1624
|
-
|
1625
|
-
1.2.3.4@4000 -> 1, means that to connect to VM port 1, you need to
|
1626
|
-
connect to IP 1.2.3.4 in port 4000
|
1627
|
-
EOT
|
1628
|
-
|
1629
|
-
command :'port-forward',
|
1630
|
-
port_desc,
|
1631
|
-
:vmid,
|
1632
|
-
[:port, nil],
|
1633
|
-
:options => NIC_ID do
|
1634
|
-
helper.perform_action(args[0], options, 'Port Forward') do |vm|
|
1635
|
-
rc = vm.info
|
1636
|
-
|
1637
|
-
if OpenNebula.is_error?(rc)
|
1638
|
-
STDERR.puts rc.message
|
1639
|
-
exit(-1)
|
1640
|
-
end
|
1641
|
-
|
1642
|
-
if options[:nic_id]
|
1643
|
-
nic = vm.retrieve_xmlelements(
|
1644
|
-
"//TEMPLATE/NIC[NIC_ID=\"#{options[:nic_id]}\"]"
|
1645
|
-
)[0]
|
1646
|
-
else
|
1647
|
-
nic = vm.retrieve_xmlelements('//TEMPLATE/NIC[SSH="YES"]')[0]
|
1648
|
-
end
|
1649
|
-
|
1650
|
-
nic = vm.retrieve_xmlelements('//TEMPLATE/NIC[1]')[0] if nic.nil?
|
1651
|
-
|
1652
|
-
if nic.nil?
|
1653
|
-
STDERR.puts 'No NIC found'
|
1654
|
-
exit(-1)
|
1655
|
-
end
|
1656
|
-
|
1657
|
-
if nic['EXTERNAL_PORT_RANGE'].nil?
|
1658
|
-
STDERR.puts 'No PORT_RANGE found'
|
1659
|
-
exit(-1)
|
1660
|
-
end
|
1661
|
-
|
1662
|
-
ip = vm.to_hash['VM']['HISTORY_RECORDS']['HISTORY'][-1]['HOSTNAME']
|
1663
|
-
|
1664
|
-
e_range = nic['EXTERNAL_PORT_RANGE'].split(':')
|
1665
|
-
e_start_p = Integer(e_range[0])
|
1666
|
-
e_end_p = Integer(e_range[1])
|
1667
|
-
|
1668
|
-
i_range = nic['INTERNAL_PORT_RANGE'].split('-')
|
1669
|
-
i_start_p = Integer(i_range[0])
|
1670
|
-
i_end_p = Integer(i_range[1].split('/')[0])
|
1671
|
-
|
1672
|
-
if args[1].nil?
|
1673
|
-
[*e_start_p..e_end_p].zip([*i_start_p..i_end_p]) do |p1, p2|
|
1674
|
-
puts "#{ip}@#{p1} -> #{p2}"
|
1675
|
-
end
|
1676
|
-
else
|
1677
|
-
puts "#{ip}@#{e_start_p + Integer(args[1]) - 1} -> #{args[1]}"
|
1678
|
-
end
|
1679
|
-
end
|
1680
|
-
|
1681
|
-
end
|
1682
|
-
|
1683
1521
|
# Deprecated commands
|
1684
1522
|
|
1685
1523
|
deprecated_command(:shutdown, 'terminate')
|
data/bin/onevmgroup
CHANGED
@@ -26,25 +26,14 @@ else
|
|
26
26
|
GEMS_LOCATION = ONE_LOCATION + '/share/gems'
|
27
27
|
end
|
28
28
|
|
29
|
-
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
29
|
if File.directory?(GEMS_LOCATION)
|
31
30
|
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
31
|
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
32
|
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
33
|
+
require 'rubygems'
|
34
|
+
Gem.use_paths(real_gems_path)
|
45
35
|
end
|
46
36
|
end
|
47
|
-
# %%RUBYGEMS_SETUP_END%%
|
48
37
|
|
49
38
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
50
39
|
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
@@ -242,9 +231,9 @@ CommandParser::CmdParser.new(ARGV) do
|
|
242
231
|
[Admin]: locks only Admin actions.
|
243
232
|
EOT
|
244
233
|
|
245
|
-
command :lock, lock_desc,
|
234
|
+
command :lock, lock_desc, :vmgroupid,
|
246
235
|
:options => [USE, MANAGE, ADMIN, ALL] do
|
247
|
-
helper.
|
236
|
+
helper.perform_action(args[0], options, 'VMGroup locked') do |vmg|
|
248
237
|
if !options[:use].nil?
|
249
238
|
level = 1
|
250
239
|
elsif !options[:manage].nil?
|
@@ -265,8 +254,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
265
254
|
Valid states are: All.
|
266
255
|
EOT
|
267
256
|
|
268
|
-
command :unlock, unlock_desc,
|
269
|
-
helper.
|
257
|
+
command :unlock, unlock_desc, :vmgroupid do
|
258
|
+
helper.perform_action(args[0], options, 'VMGroup unlocked') do |vmg|
|
270
259
|
vmg.unlock
|
271
260
|
end
|
272
261
|
end
|
data/bin/onevnet
CHANGED
@@ -26,25 +26,14 @@ else
|
|
26
26
|
GEMS_LOCATION = ONE_LOCATION + '/share/gems'
|
27
27
|
end
|
28
28
|
|
29
|
-
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
29
|
if File.directory?(GEMS_LOCATION)
|
31
30
|
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
31
|
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
32
|
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
33
|
+
require 'rubygems'
|
34
|
+
Gem.use_paths(real_gems_path)
|
45
35
|
end
|
46
36
|
end
|
47
|
-
# %%RUBYGEMS_SETUP_END%%
|
48
37
|
|
49
38
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
50
39
|
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
@@ -390,9 +379,9 @@ CommandParser::CmdParser.new(ARGV) do
|
|
390
379
|
[Admin]: locks only Admin actions.
|
391
380
|
EOT
|
392
381
|
|
393
|
-
command :lock, lock_desc,
|
382
|
+
command :lock, lock_desc, :vnetid,
|
394
383
|
:options => [USE, MANAGE, ADMIN, ALL] do
|
395
|
-
helper.
|
384
|
+
helper.perform_action(args[0], options, 'VNet locked') do |vnet|
|
396
385
|
if !options[:use].nil?
|
397
386
|
level = 1
|
398
387
|
elsif !options[:manage].nil?
|
@@ -413,8 +402,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
413
402
|
Valid states are: All.
|
414
403
|
EOT
|
415
404
|
|
416
|
-
command :unlock, unlock_desc,
|
417
|
-
helper.
|
405
|
+
command :unlock, unlock_desc, :vnetid do
|
406
|
+
helper.perform_action(args[0], options, 'VNet unlocked') do |vnet|
|
418
407
|
vnet.unlock
|
419
408
|
end
|
420
409
|
end
|
data/bin/onevntemplate
CHANGED
@@ -26,25 +26,14 @@ else
|
|
26
26
|
GEMS_LOCATION = ONE_LOCATION + '/share/gems'
|
27
27
|
end
|
28
28
|
|
29
|
-
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
29
|
if File.directory?(GEMS_LOCATION)
|
31
30
|
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
31
|
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
32
|
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
33
|
+
require 'rubygems'
|
34
|
+
Gem.use_paths(real_gems_path)
|
45
35
|
end
|
46
36
|
end
|
47
|
-
# %%RUBYGEMS_SETUP_END%%
|
48
37
|
|
49
38
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
50
39
|
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
@@ -350,9 +339,9 @@ CommandParser::CmdParser.new(ARGV) do
|
|
350
339
|
[Admin]: locks only Admin actions.
|
351
340
|
EOT
|
352
341
|
|
353
|
-
command :lock, lock_desc,
|
342
|
+
command :lock, lock_desc, :templateid,
|
354
343
|
:options => [USE, MANAGE, ADMIN, ALL] do
|
355
|
-
helper.
|
344
|
+
helper.perform_action(args[0], options, 'VN Template locked') do |t|
|
356
345
|
if !options[:use].nil?
|
357
346
|
level = 1
|
358
347
|
elsif !options[:manage].nil?
|
@@ -373,8 +362,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
373
362
|
Valid states are: All.
|
374
363
|
EOT
|
375
364
|
|
376
|
-
command :unlock, unlock_desc,
|
377
|
-
helper.
|
365
|
+
command :unlock, unlock_desc, :templateid do
|
366
|
+
helper.perform_action(args[0], options, 'VN Template unlocked') do |t|
|
378
367
|
t.unlock
|
379
368
|
end
|
380
369
|
end
|
data/bin/onevrouter
CHANGED
@@ -26,25 +26,14 @@ else
|
|
26
26
|
GEMS_LOCATION = ONE_LOCATION + '/share/gems'
|
27
27
|
end
|
28
28
|
|
29
|
-
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
29
|
if File.directory?(GEMS_LOCATION)
|
31
30
|
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
31
|
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
32
|
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
33
|
+
require 'rubygems'
|
34
|
+
Gem.use_paths(real_gems_path)
|
45
35
|
end
|
46
36
|
end
|
47
|
-
# %%RUBYGEMS_SETUP_END%%
|
48
37
|
|
49
38
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
50
39
|
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
@@ -375,9 +364,9 @@ CommandParser::CmdParser.new(ARGV) do
|
|
375
364
|
[Admin]: locks only Admin actions.
|
376
365
|
EOT
|
377
366
|
|
378
|
-
command :lock, lock_desc,
|
367
|
+
command :lock, lock_desc, :vrouterid,
|
379
368
|
:options => [USE, MANAGE, ADMIN, ALL] do
|
380
|
-
helper.
|
369
|
+
helper.perform_action(args[0], options, 'VRouter locked') do |vr|
|
381
370
|
if !options[:use].nil?
|
382
371
|
level = 1
|
383
372
|
elsif !options[:manage].nil?
|
@@ -398,8 +387,8 @@ CommandParser::CmdParser.new(ARGV) do
|
|
398
387
|
valid states are: All.
|
399
388
|
EOT
|
400
389
|
|
401
|
-
command :unlock, unlock_desc,
|
402
|
-
helper.
|
390
|
+
command :unlock, unlock_desc, :vrouterid do
|
391
|
+
helper.perform_action(args[0], options, 'VRouter unlocked') do |vr|
|
403
392
|
vr.unlock
|
404
393
|
end
|
405
394
|
end
|
data/bin/onezone
CHANGED
@@ -26,25 +26,14 @@ else
|
|
26
26
|
GEMS_LOCATION = ONE_LOCATION + '/share/gems'
|
27
27
|
end
|
28
28
|
|
29
|
-
# %%RUBYGEMS_SETUP_BEGIN%%
|
30
29
|
if File.directory?(GEMS_LOCATION)
|
31
30
|
real_gems_path = File.realpath(GEMS_LOCATION)
|
32
31
|
if !defined?(Gem) || Gem.path != [real_gems_path]
|
33
32
|
$LOAD_PATH.reject! {|l| l =~ /vendor_ruby/ }
|
34
|
-
|
35
|
-
|
36
|
-
# https://github.com/OpenNebula/one/issues/5379
|
37
|
-
begin
|
38
|
-
verb = $VERBOSE
|
39
|
-
$VERBOSE = nil
|
40
|
-
require 'rubygems'
|
41
|
-
Gem.use_paths(real_gems_path)
|
42
|
-
ensure
|
43
|
-
$VERBOSE = verb
|
44
|
-
end
|
33
|
+
require 'rubygems'
|
34
|
+
Gem.use_paths(real_gems_path)
|
45
35
|
end
|
46
36
|
end
|
47
|
-
# %%RUBYGEMS_SETUP_END%%
|
48
37
|
|
49
38
|
$LOAD_PATH << RUBY_LIB_LOCATION
|
50
39
|
$LOAD_PATH << RUBY_LIB_LOCATION + '/cli'
|
@@ -265,7 +254,7 @@ CommandParser::CmdParser.new(ARGV) do
|
|
265
254
|
end
|
266
255
|
|
267
256
|
server = Replicator.new('/var/lib/one/.ssh/id_rsa', args[0])
|
268
|
-
server.process_files(options
|
257
|
+
server.process_files(options.key?(:database))
|
269
258
|
|
270
259
|
0
|
271
260
|
end
|