win_updates: fix regression when using string cat names (#36015)

(cherry picked from commit 8fb66c18de)
pull/36222/head
Jordan Borean 7 years ago
parent ac44b2062d
commit 375bc11139
No known key found for this signature in database
GPG Key ID: 2AAC89085FBBDAB5

@ -6,6 +6,7 @@ import json
from ansible.errors import AnsibleError from ansible.errors import AnsibleError
from ansible.module_utils._text import to_text from ansible.module_utils._text import to_text
from ansible.module_utils.parsing.convert_bool import boolean from ansible.module_utils.parsing.convert_bool import boolean
from ansible.parsing.yaml.objects import AnsibleUnicode
from ansible.plugins.action import ActionBase from ansible.plugins.action import ActionBase
try: try:
@ -140,6 +141,9 @@ class ActionModule(ActionBase):
'SecurityUpdates', 'SecurityUpdates',
'UpdateRollups', 'UpdateRollups',
]) ])
if isinstance(category_names, AnsibleUnicode):
category_names = [cat.strip() for cat in category_names.split(",")]
state = self._task.args.get('state', 'installed') state = self._task.args.get('state', 'installed')
reboot = self._task.args.get('reboot', False) reboot = self._task.args.get('reboot', False)
reboot_timeout = self._task.args.get('reboot_timeout', reboot_timeout = self._task.args.get('reboot_timeout',

@ -43,8 +43,7 @@
- name: search for updates with log output (check) - name: search for updates with log output (check)
win_updates: win_updates:
state: searched state: searched
category_names: category_names: CriticalUpdates
- CriticalUpdates
log_path: '{{win_updates_dir}}/update.log' log_path: '{{win_updates_dir}}/update.log'
register: update_search_with_log_check register: update_search_with_log_check
check_mode: yes check_mode: yes

Loading…
Cancel
Save