mirror of
https://github.com/fog/fog.git
synced 2022-11-09 13:51:43 -05:00
delete vms that is not ready for vm.config, e.g. during the creation period
This commit is contained in:
parent
6ca3880a31
commit
63a98f8d97
2 changed files with 4 additions and 4 deletions
|
@ -18,7 +18,7 @@ module Fog
|
|||
|
||||
vms = folder.children.grep(RbVmomi::VIM::VirtualMachine)
|
||||
# remove all virtual machines that are not template
|
||||
vms.delete_if { |v| not v.config.template }
|
||||
vms.delete_if { |v| v.config.nil? or not v.config.template }
|
||||
|
||||
vms.map(&method(:convert_vm_mob_ref_to_attr_hash))
|
||||
end
|
||||
|
@ -34,7 +34,7 @@ module Fog
|
|||
}).view
|
||||
end.flatten
|
||||
# remove all virtual machines that are not templates
|
||||
vms.delete_if { |v| not v.config.template }
|
||||
vms.delete_if { |v| v.config.nil? or not v.config.template }
|
||||
|
||||
vms.map(&method(:convert_vm_mob_ref_to_attr_hash))
|
||||
end
|
||||
|
|
|
@ -24,7 +24,7 @@ module Fog
|
|||
|
||||
vms = folder.children.grep(RbVmomi::VIM::VirtualMachine)
|
||||
# remove all template based virtual machines
|
||||
vms.delete_if { |v| v.config.template }
|
||||
vms.delete_if { |v| v.config.nil? or v.config.template }
|
||||
|
||||
vms.map(&method(:convert_vm_mob_ref_to_attr_hash))
|
||||
end
|
||||
|
@ -43,7 +43,7 @@ module Fog
|
|||
vms = convert_vm_view_to_attr_hash(vms)
|
||||
|
||||
# remove all template based virtual machines
|
||||
vms.delete_if { |v| v['template'] }
|
||||
vms.delete_if { |v| v.config.nil? or v['template'] }
|
||||
vms
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue