Revision f22ca784 src/vmm_mad/remotes/vcenter/vcenter_driver.rb

View differences:

src/vmm_mad/remotes/vcenter/vcenter_driver.rb
232 232
    # @return [Hash] in the form
233 233
    #   {dc_name [String] => ClusterComputeResources Names [Array - String]}
234 234
    ########################################################################
235
    def hierarchy
235
    def hierarchy(one_client=nil)
236 236
        vc_hosts = {}
237 237

  
238 238
        datacenters = get_entities(@root, 'Datacenter')
239 239

  
240
        hpool = OpenNebula::HostPool.new((one_client||@one))
241
        rc    = hpool.info
242

  
240 243
        datacenters.each { |dc|
241 244
            ccrs = get_entities(dc.hostFolder, 'ClusterComputeResource')
242
            vc_hosts[dc.name] = ccrs.collect { |c| c.name }
245
            vc_hosts[dc.name] = []
246
            ccrs.each { |c|
247
                puts c.name
248
                if !hpool["HOST[NAME=\"c.name\"]"]
249
                    vc_hosts[dc.name] << c.name
250
                end
251
              }
243 252
        }
244 253

  
245 254
        return vc_hosts

Also available in: Unified diff