Allow all of yum version compare operators (#54603)

* Allow all of yum version compare operators

* * yum: name="foo >= VERSION" integration test
* changelog fragment
This commit is contained in:
Robert Osowiecki 2019-04-08 10:34:21 +02:00 committed by Martin Krizek
commit 1532e31ec0
3 changed files with 60 additions and 6 deletions

View file

@ -101,12 +101,13 @@ class YumDnf(with_metaclass(ABCMeta, object)):
# Fail if someone passed a space separated string
# https://github.com/ansible/ansible/issues/46301
if any((' ' in name and '@' not in name and '==' not in name for name in self.names)):
module.fail_json(
msg='It appears that a space separated string of packages was passed in '
'as an argument. To operate on several packages, pass a comma separated '
'string of packages or a list of packages.'
)
for name in self.names:
if ' ' in name and not any(spec in name for spec in ['@', '>', '<', '=']):
module.fail_json(
msg='It appears that a space separated string of packages was passed in '
'as an argument. To operate on several packages, pass a comma separated '
'string of packages or a list of packages.'
)
# Sanity checking for autoremove
if self.state is None: