Merge pull request #10812 from jcpowermac/fix_vmware_util_module

Fixes VMware module utils
This commit is contained in:
Brian Coca 2015-04-22 15:08:57 -04:00
commit c11e7184da

View file

@ -39,14 +39,14 @@ def wait_for_task(task):
while True: while True:
if task.info.state == vim.TaskInfo.State.success: if task.info.state == vim.TaskInfo.State.success:
return True, task.info.result return True, task.info.result
if task.info.state == vim.TaskInfo.State.error if task.info.state == vim.TaskInfo.State.error:
try: try:
raise TaskError(task.info.error) raise TaskError(task.info.error)
except AttributeError: except AttributeError:
raise TaskError("An unknown error has occurred") raise TaskError("An unknown error has occurred")
if task.info.state == vim.TaskInfo.State.running: if task.info.state == vim.TaskInfo.State.running:
time.sleep(15) time.sleep(15)
if task.info.state = vim.TaskInfo.State.queued: if task.info.state == vim.TaskInfo.State.queued:
time.sleep(15) time.sleep(15)
@ -70,7 +70,7 @@ def find_cluster_by_name_datacenter(datacenter, cluster_name):
return None return None
def find_datacenter_by_name(content, datacenter_name, throw=True): def find_datacenter_by_name(content, datacenter_name):
datacenters = get_all_objs(content, [vim.Datacenter]) datacenters = get_all_objs(content, [vim.Datacenter])
for dc in datacenters: for dc in datacenters: