* 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:
parent
f3b5e0359f
commit
4fe7671d34
3 changed files with 16 additions and 0 deletions
3
changelogs/fragments/yum_bugfux.yml
Normal file
3
changelogs/fragments/yum_bugfux.yml
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
minor_changes:
|
||||||
|
- fix yum module to handle list argument optional empty strings properly
|
|
@ -110,6 +110,9 @@ class YumDnf(with_metaclass(ABCMeta, object)):
|
||||||
|
|
||||||
some_list.extend(new_list)
|
some_list.extend(new_list)
|
||||||
|
|
||||||
|
if some_list == [""]:
|
||||||
|
return []
|
||||||
|
|
||||||
return some_list
|
return some_list
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
|
|
@ -83,6 +83,16 @@
|
||||||
that:
|
that:
|
||||||
- "not yum_result is changed"
|
- "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
|
# INSTALL AGAIN WITH LATEST
|
||||||
- name: install sos again with state latest in check mode
|
- name: install sos again with state latest in check mode
|
||||||
yum: name=sos state=latest
|
yum: name=sos state=latest
|
||||||
|
|
Loading…
Reference in a new issue