Show VMs that use the image in oneimage show

This commit is contained in:
Javi Fontan committed 2013-01-31 17:59:20 +01:00
1 parent ddca48fd8c
commit 15f718d994
2 files changed
+23 -1

No files matched your search

+9 -1
View File
@@ -315,7 +315,15 @@ EOT
pool_to_array(pool)
}
else
table.show(pool_to_array(pool), options)
array=pool_to_array(pool)
if options[:ids]
array=array.select do |element|
options[:ids].include? element['ID'].to_i
end
end
table.show(array, options)
end
return 0
+14
View File
@@ -15,6 +15,7 @@
#--------------------------------------------------------------------------- #
require 'one_helper'
require 'one_helper/onevm_helper'
class OneImageHelper < OpenNebulaHelper::OneHelper
TEMPLATE_OPTIONS=[
@@ -298,6 +299,19 @@ class OneImageHelper < OpenNebulaHelper::OneHelper
CLIHelper.print_header(str_h1 % "IMAGE TEMPLATE",false)
puts image.template_str
puts
CLIHelper.print_header("VIRTUAL MACHINES", false)
puts
vms=image.retrieve_elements("VMS/ID")
if vms
vms.map!{|e| e.to_i }
onevm_helper=OneVMHelper.new
onevm_helper.client=@client
onevm_helper.list_pool({:ids=>vms}, false)
end
end
def self.create_image_variables(options, name)