Ensure we have enough values to split (#56802)

Avoid raising an exception if pkgstr does not complains with expected
value.
This commit is contained in:
Adrián López 2020-03-24 15:46:58 +01:00 committed by GitHub
parent 550e021cd2
commit 433c98eae0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -807,7 +807,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}