Sha256: 7bad7b3b3cd1e095c71e462f181df4bd349873194c4a03dc98fb1d171a517edc
Contents?: true
Size: 881 Bytes
Versions: 11
Compression:
Stored size: 881 Bytes
Contents
module Fog module Vsphere class Compute class Real def get_datacenter(name) dc = find_raw_datacenter(name) raise(Fog::Vsphere::Compute::NotFound) unless dc { name: dc.name, status: dc.overallStatus, path: raw_getpathmo(dc) } end protected def find_raw_datacenter(name) raw_datacenters.find { |d| d.name == name || raw_getpathmo(d).join('/') == name } || get_raw_datacenter(name) end # @note RbVmomi takes path instead of name as argument to find datacenter def get_raw_datacenter(path) connection.serviceInstance.find_datacenter(path) end end class Mock def get_datacenter(name) dc = data[:datacenters][name] raise(Fog::Vsphere::Compute::NotFound) unless dc dc end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems