1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

yum: fix false error msg about autoremove support (#56459)

* yum: fix false error msg about autoremove support
This commit is contained in:
Martin Krizek 2019-05-21 17:37:05 +02:00 committed by Sam Doran
parent 77f997474a
commit a68ac729ea
2 changed files with 4 additions and 3 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- yum - Fix false error message about autoremove not being supported (https://github.com/ansible/ansible/issues/56458)

View file

@ -1083,9 +1083,8 @@ class YumModule(YumDnf):
res['msg'] = err
if rc != 0:
if self.autoremove:
if 'No such command' not in out:
self.module.fail_json(msg='Version of YUM too old for autoremove: Requires yum 3.4.3 (RHEL/CentOS 7+)')
if self.autoremove and 'No such command' in out:
self.module.fail_json(msg='Version of YUM too old for autoremove: Requires yum 3.4.3 (RHEL/CentOS 7+)')
else:
self.module.fail_json(**res)