1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-18 02:50:09 +03:00

feature : make vcenter recursive search compatible with ruby 1.8.7

(cherry picked from commit a093e08780b98a5b8728fb37ffd21ef09aefe91a)
This commit is contained in:
Javi Fontan 2014-11-18 18:53:13 +01:00
parent 12157a9a25
commit 7b84345926

@ -51,14 +51,15 @@ module VCenterDriver
class VIClient
attr_reader :vim, :one, :root, :cluster, :user, :pass, :host
def get_entities(entities=[], folder, type)
def get_entities(folder, type, entities=[])
return nil if folder == []
folder.childEntity.each do |child|
name, junk = child.to_s.split('(')
case name
when "Folder"
get_entities(entities, child, type)
get_entities(child, type, entities)
when type
entities.push(child)
end