mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #1112: Fix CLI option procs
This commit is contained in:
parent
dce32e1351
commit
b304a6d896
@ -311,7 +311,7 @@ EOT
|
||||
|
||||
opts.on(*args) do |o|
|
||||
if e[:proc]
|
||||
@options[e[:name].to_sym]=e[:proc].call(o, @options)
|
||||
e[:proc].call(o, @options)
|
||||
elsif e[:name]=="help"
|
||||
help
|
||||
exit
|
||||
|
@ -202,7 +202,7 @@ EOT
|
||||
|
||||
result = names.split(',').collect { |name|
|
||||
if name.match(/^[0123456789]+$/)
|
||||
name
|
||||
name.to_i
|
||||
else
|
||||
rc = OneHelper.name_to_id(name, pool, poolname)
|
||||
|
||||
|
@ -27,7 +27,13 @@ class OneClusterHelper < OpenNebulaHelper::OneHelper
|
||||
:proc => lambda { |o, options|
|
||||
ch = OneClusterHelper.new
|
||||
rc, cid = ch.to_id(o)
|
||||
cid
|
||||
if rc == 0
|
||||
options[:cluster] = cid
|
||||
else
|
||||
puts cid
|
||||
puts "option cluster: Parsing error"
|
||||
exit -1
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,13 @@ class OneDatastoreHelper < OpenNebulaHelper::OneHelper
|
||||
:proc => lambda { |o, options|
|
||||
ch = OneDatastoreHelper.new
|
||||
rc, dsid = ch.to_id(o)
|
||||
dsid
|
||||
if rc == 0
|
||||
options[:datastore] = dsid
|
||||
else
|
||||
puts dsid
|
||||
puts "option datastore: Parsing error"
|
||||
exit -1
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user