Skip to content

Commit

Permalink
Be more verbose when in debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
dnaeon committed Mar 27, 2014
1 parent 33f53ff commit 6b2083c
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/vpoller/connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,42 +109,54 @@ def get_all_datacenters(self):
Get a list of all pyVmomi.vim.Datacenter managed objects
"""
return self._get_all_objects(obj_type=[pyVmomi.vim.Datacenter])
obj_type = pyVmomi.vim.Datacenter
logging.debug('Getting all %s managed objects', obj_type.__name__)
return self._get_all_objects(obj_type=[obj_type])

def get_all_clusters(self):
"""
Get a list of all pyVmomi.vim.ClusterComputeResource managed objects
"""
return self._get_all_objects(obj_type=[pyVmomi.vim.ClusterComputeResource])
obj_type = pyVmomi.vim.ClusterComputeResource
logging.debug('Getting all %s managed objects', obj_type.__name__)
return self._get_all_objects(obj_type=[obj_type])

def get_all_hosts(self):
"""
Get a list of a ll pyVmomi.vim.HostSystem managed objects
"""
return self._get_all_objects(obj_type=[pyVmomi.vim.HostSystem])
obj_type = pyVmomi.vim.HostSystem
logging.debug('Getting all %s managed objects', obj_type.__name__)
return self._get_all_objects(obj_type=[obj_type])

def get_all_vms(self):
"""
Get a list of all pyVmomi.vim.VirtualMachine managed objects
"""
return self._get_all_objects(obj_type=[pyVmomi.vim.VirtualMachine])
obj_type = pyVmomi.vim.VirtualMachine
logging.debug('Getting all %s managed objects', obj_type.__name__)
return self._get_all_objects(obj_type=[obj_type])

def get_all_datastores(self):
"""
Get a list of all pyVmomi.vim.Datastore managed objects
"""
return self._get_all_objects(obj_type=[pyVmomi.vim.Datastore])
obj_type = pyVmomi.vim.Datastore
logging.debug('Getting all %s managed objects', obj_type.__name__)
return self._get_all_objects(obj_type=[obj_type])

def get_all_resource_pools(self):
"""
Get a list of all pyVmomi.vim.ResourcePool managed objects
"""
return self._get_all_objects(obj_type=[pyVmomi.vim.ResourcePool])
obj_type = pyVmomi.vim.ResourcePool
logging.debug('Getting all %s managed objects', obj_type.__name__)
return self._get_all_objects(obj_type=[obj_type])

def _get_all_objects(self, obj_type):
"""
Expand Down

0 comments on commit 6b2083c

Please sign in to comment.