From 73ba6a9bc80e54f0a45a273abf1d2b2220c03586 Mon Sep 17 00:00:00 2001 From: mtward Date: Mon, 11 Mar 2019 03:37:28 -0400 Subject: [PATCH] VMware: return failure when shutdownguest fails with timeout (#52952) If the state_change_timeout was exceeded in shutdownguest, there was no failure. This adds a failure in that case. --- lib/ansible/modules/cloud/vmware/vmware_guest.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/ansible/modules/cloud/vmware/vmware_guest.py b/lib/ansible/modules/cloud/vmware/vmware_guest.py index 4ef73678a6..aebc34a462 100644 --- a/lib/ansible/modules/cloud/vmware/vmware_guest.py +++ b/lib/ansible/modules/cloud/vmware/vmware_guest.py @@ -2616,6 +2616,9 @@ def main(): if not tmp_result["failed"]: result["failed"] = False result['instance'] = tmp_result['instance'] + if tmp_result["failed"]: + result["failed"] = True + result["msg"] = tmp_result["msg"] else: # This should not happen raise AssertionError()