Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

win_updates: fix regression when using string cat names #36015

Merged
merged 1 commit into from
Feb 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/ansible/plugins/action/win_updates.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from ansible.errors import AnsibleError
from ansible.module_utils._text import to_text
from ansible.module_utils.parsing.convert_bool import boolean
from ansible.parsing.yaml.objects import AnsibleUnicode
from ansible.plugins.action import ActionBase

try:
Expand Down Expand Up @@ -140,6 +141,9 @@ def run(self, tmp=None, task_vars=None):
'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',
Expand Down
3 changes: 1 addition & 2 deletions test/integration/targets/win_updates/tasks/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@
- name: search for updates with log output (check)
win_updates:
state: searched
category_names:
- CriticalUpdates
category_names: CriticalUpdates
log_path: '{{win_updates_dir}}/update.log'
register: update_search_with_log_check
check_mode: yes
Expand Down