2.9: YUM: Ensure we have enough values to split (#56802) (#71104)

* Ensure we have enough values to split (#56802)

Avoid raising an exception if pkgstr does not complains with expected
value.

(cherry picked from commit 433c98eae0)

* Add changelog

Co-authored-by: Adrián López <adrianlzt+github@gmail.com>
pull/70851/head
Martin Krizek 5 years ago committed by GitHub
parent cea92ad2cd
commit f097589fb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- yum - fix yum list crashing if repoquery (used internally) prints errors in stdout (https://github.com/ansible/ansible/issues/56800)

@ -809,7 +809,7 @@ class YumModule(YumDnf):
os.environ["https_proxy"] = old_proxy_env[1]
def pkg_to_dict(self, pkgstr):
if pkgstr.strip():
if pkgstr.strip() and pkgstr.count('|') == 5:
n, e, v, r, a, repo = pkgstr.split('|')
else:
return {'error_parsing': pkgstr}

Loading…
Cancel
Save