1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-01-25 06:03:36 +03:00

Bug #2624: Add ALL option for cluster_id in CLI

This commit is contained in:
Tino Vazquez 2014-01-13 12:08:10 +01:00
parent 1010a9ed94
commit 3a79c79953
2 changed files with 10 additions and 1 deletions

View File

@ -556,6 +556,10 @@ EOT
end
def self.name_to_id(name, pool, ename)
if ename=="CLUSTER" and name=="ALL"
return 0, "ALL"
end
objects=pool.select {|object| object.name==name }
if objects.length>0

View File

@ -236,10 +236,15 @@ cmd=CommandParser::CmdParser.new(ARGV) do
end
add_provider_desc = <<-EOT.unindent
Adds a resource provider (cluster of a zone) to the given group
Adds a resource provider (cluster of a zone) to the given group.
clusterid can be set to ALL
EOT
command :add_provider, add_provider_desc, [:range, :groupid_list], :zoneid, :clusterid do
if args[2] and args[2].upcase == "ALL"
args[2]=10
end
helper.perform_actions(args[0],options,"resource provider added") do |obj|
obj.add_provider(args[1].to_i, args[2].to_i)
end