yum module handle list optional empty strings properly (#46634) (#46819)

* yum module handle list optional empty strings properly (#46634)

Fixes #46517

Signed-off-by: Adam Miller <admiller@redhat.com>
(cherry picked from commit ad405fc21e)

* add changelog

Signed-off-by: Adam Miller <admiller@redhat.com>
This commit is contained in:
Adam Miller 2018-10-11 11:41:04 -05:00 committed by Toshio Kuratomi
parent f3b5e0359f
commit 4fe7671d34
3 changed files with 16 additions and 0 deletions

View file

@ -0,0 +1,3 @@
---
minor_changes:
- fix yum module to handle list argument optional empty strings properly

View file

@ -110,6 +110,9 @@ class YumDnf(with_metaclass(ABCMeta, object)):
some_list.extend(new_list)
if some_list == [""]:
return []
return some_list
@abstractmethod

View file

@ -83,6 +83,16 @@
that:
- "not yum_result is changed"
- name: install sos again with empty string enablerepo
yum: name=sos state=present enablerepo=""
register: yum_result
- name: verify no change on third install with empty string enablerepo
assert:
that:
- "yum_result is success"
- "not yum_result is changed"
# INSTALL AGAIN WITH LATEST
- name: install sos again with state latest in check mode
yum: name=sos state=latest