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

* yum: fix false error msg about autoremove support

(cherry picked from commit a68ac729ea)
pull/56824/head
Martin Krizek 7 years ago committed by Toshio Kuratomi
parent 3a3314e9ff
commit 0176c8893b

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

@ -1067,9 +1067,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)

Loading…
Cancel
Save