From b7620c161a6ecb40da3d94871a03674023b14ef1 Mon Sep 17 00:00:00 2001 From: Jordan Borean Date: Fri, 18 Jan 2019 05:35:10 +1000 Subject: [PATCH] win_updates - fix category return value to be a list (#51001) * win_updates - fix category return value to be a list * remove unstable test alias --- lib/ansible/modules/windows/win_updates.ps1 | 2 +- lib/ansible/plugins/action/win_updates.py | 8 -------- test/integration/targets/win_updates/aliases | 1 - 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/lib/ansible/modules/windows/win_updates.ps1 b/lib/ansible/modules/windows/win_updates.ps1 index ff9df503224..1f382587d45 100644 --- a/lib/ansible/modules/windows/win_updates.ps1 +++ b/lib/ansible/modules/windows/win_updates.ps1 @@ -112,7 +112,7 @@ $update_script_block = { kb = $update.KBArticleIDs id = $update.Identity.UpdateId installed = $false - categories = ($update.Categories | ForEach-Object { $_.Name }) + categories = @($update.Categories | ForEach-Object { $_.Name }) } # validate update again blacklist/whitelist/post_category_names/hidden diff --git a/lib/ansible/plugins/action/win_updates.py b/lib/ansible/plugins/action/win_updates.py index 538af250a3b..e096b8302e3 100644 --- a/lib/ansible/plugins/action/win_updates.py +++ b/lib/ansible/plugins/action/win_updates.py @@ -134,14 +134,6 @@ class ActionModule(ActionBase): result = super(ActionModule, self).run(tmp, task_vars) del tmp # tmp no longer has any effect - category_names = self._task.args.get('category_names', [ - 'CriticalUpdates', - 'SecurityUpdates', - 'UpdateRollups', - ]) - if isinstance(category_names, AnsibleUnicode): - category_names = [cat.strip() for cat in category_names.split(",")] - state = self._task.args.get('state', 'installed') reboot = self._task.args.get('reboot', False) reboot_timeout = self._task.args.get('reboot_timeout', diff --git a/test/integration/targets/win_updates/aliases b/test/integration/targets/win_updates/aliases index 98b74ac9877..423ce391085 100644 --- a/test/integration/targets/win_updates/aliases +++ b/test/integration/targets/win_updates/aliases @@ -1,2 +1 @@ shippable/windows/group2 -unstable