Add error logging when 'yum list available' returns nonzero exit status

See https://github.com/saltstack/salt/pull/29496/files#r47160364

CC: @SEJeff
This commit is contained in:
Erik Johnson 2015-12-10 09:17:24 -06:00
parent 263135b61c
commit b68c6614f1

View File

@ -379,6 +379,11 @@ def latest_version(*names, **kwargs):
ignore_retcode=True,
python_shell=False)
if out['retcode'] != 0 and 'Error:' in out:
if out['stderr']:
log.error(
'Problem encountered getting list of available updates. '
'Stderr follows: {0}'.format(out['stderr'])
)
return []
# Find end of first line so we can skip it
header_end = out['stdout'].find('\n')