Exemplo n.º 1
0
 def identify_datacenter(self):
     dcs = Datacenter.all(self.client)
     if self.dcname is None:
         self.datacenter = dcs[0]
         logging.info('defaulting to data center %s' % (self.datacenter.name))
     else:
         for dc in dcs:
             if dc.name == self.dcname:
                 self.datacenter = dc
                 break
         if self.datacenter is None:
             raise ValueError('no data center named %s' % (self.dcname))
def get_datacenter(client):
    datacenters = Datacenter.all(client.api)
    return api_params_resolution(datacenters, 'datacenter', 'datacenter')
def get_datacenter(client):
    from psphere.managedobjects import Datacenter
    datacenters = Datacenter.all(client)

    return api_params_resolution(datacenters, 'datacenter', 'datacenter')
def get_datacenter(client):
    datacenters = Datacenter.all(client.api)
    return api_params_resolution(datacenters, 'datacenter', 'datacenter')
Exemplo n.º 5
0
def get_datacenter(client):
    from psphere.managedobjects import Datacenter
    datacenters = Datacenter.all(client)

    return api_params_resolution(datacenters, 'datacenter', 'datacenter')
Exemplo n.º 6
0
 def get_datacenters(self):
     datacenters = Datacenter.all(self.client)
     return datacenters