From 87bc7058060457d4802a10a7a2df71aaaf7bf158 Mon Sep 17 00:00:00 2001 From: Joseph Callen Date: Wed, 22 Apr 2015 14:54:05 -0400 Subject: [PATCH] Fixes VMware module utils Resolves syntax errors in the `wait_for_tasks` Removes throw from `find_datacenter_by_name` --- lib/ansible/module_utils/vmware.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/vmware.py b/lib/ansible/module_utils/vmware.py index 5d94b9d6bba..e2d8c18ca48 100644 --- a/lib/ansible/module_utils/vmware.py +++ b/lib/ansible/module_utils/vmware.py @@ -39,14 +39,14 @@ def wait_for_task(task): while True: if task.info.state == vim.TaskInfo.State.success: return True, task.info.result - if task.info.state == vim.TaskInfo.State.error + if task.info.state == vim.TaskInfo.State.error: try: raise TaskError(task.info.error) except AttributeError: raise TaskError("An unknown error has occurred") if task.info.state == vim.TaskInfo.State.running: time.sleep(15) - if task.info.state = vim.TaskInfo.State.queued: + if task.info.state == vim.TaskInfo.State.queued: time.sleep(15) @@ -70,7 +70,7 @@ def find_cluster_by_name_datacenter(datacenter, cluster_name): 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]) for dc in datacenters: