(POOLER-40) Do not return folders with get_pool_vms

This commit updates get_pool_vms to only return if the object is a VirtualMachine. Without this change a folder wtihin a VM target folder can be discovered and destroyed as though it were a VM.
This commit is contained in:
kirby@puppetlabs.com 2018-07-03 11:09:07 -07:00
parent 8be578493a
commit bd0ae2e192
2 changed files with 25 additions and 1 deletions

View file

@ -52,7 +52,7 @@ module Vmpooler
return vms if folder_object.nil?
folder_object.childEntity.each do |vm|
vms << { 'name' => vm.name }
vms << { 'name' => vm.name } if vm.is_a? RbVmomi::VIM::VirtualMachine
end
end
vms