From 2f0cfa857a78640f100bd42d42f3410df71cb94e Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Thu, 21 Jun 2018 09:27:53 +1000 Subject: [PATCH] win_updates fix when win_updates is run with async (#41756) (#41763) (cherry picked from commit 11bd3fd318244264e8dbb95ce1412d9817e53fbe) --- changelogs/fragments/win_updates-async-fix.yml | 2 ++ lib/ansible/plugins/action/win_updates.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/win_updates-async-fix.yml diff --git a/changelogs/fragments/win_updates-async-fix.yml b/changelogs/fragments/win_updates-async-fix.yml new file mode 100644 index 00000000000..3ce4c38adf3 --- /dev/null +++ b/changelogs/fragments/win_updates-async-fix.yml @@ -0,0 +1,2 @@ +bugfixes: +- win_updates - Fixed issue where running win_updates on async fails without any error diff --git a/lib/ansible/plugins/action/win_updates.py b/lib/ansible/plugins/action/win_updates.py index 766ff496993..5c7ebf792c3 100644 --- a/lib/ansible/plugins/action/win_updates.py +++ b/lib/ansible/plugins/action/win_updates.py @@ -190,7 +190,7 @@ class ActionModule(ActionBase): # so we just return the result as is # https://github.com/ansible/ansible/issues/38232 failed = result.get('failed', False) - if "updates" not in result.keys() or failed: + if ("updates" not in result.keys() and self._task.async_val == 0) or failed: result['failed'] = True return result