From 796d8b5dc8d36a84afe61b9da30779ef88e2cfcd Mon Sep 17 00:00:00 2001 From: Harald Albers Date: Tue, 11 Sep 2018 06:28:53 +0200 Subject: [PATCH] VMware: Fix wait_for_task backoff behavior (#45429) Signed-off-by: Harald Albers --- lib/ansible/module_utils/vmware.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/module_utils/vmware.py b/lib/ansible/module_utils/vmware.py index 045a063e0a..36a9f8b58b 100644 --- a/lib/ansible/module_utils/vmware.py +++ b/lib/ansible/module_utils/vmware.py @@ -58,7 +58,7 @@ def wait_for_task(task, max_backoff=64, timeout=3600): finally: raise_from(TaskError(error_msg), task.info.error) if task.info.state in [vim.TaskInfo.State.running, vim.TaskInfo.State.queued]: - sleep_time = min(2 ** failure_counter + randint(1, 1000), max_backoff) + sleep_time = min(2 ** failure_counter + randint(1, 1000) / 1000, max_backoff) time.sleep(sleep_time) failure_counter += 1