Sha256: f3e7a7e3622f79fbe070b1ea7f53262555a7c0567c450eca6eb585fea6e1ccde
Contents?: true
Size: 843 Bytes
Versions: 12
Compression:
Stored size: 843 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 } || 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
12 entries across 12 versions & 1 rubygems