Fix behaviour of function latest_version in zypper module when multiple packages are passed to function.

Function now properly return dict with empty string as version if latest packages is already installed, and multiple packages are passed to function
This commit is contained in:
xetix 2018-07-11 21:37:10 +02:00
parent 0c0c05c2bc
commit b354c6863c

View file

@ -581,6 +581,8 @@ def latest_version(*names, **kwargs):
status = pkg_info.get('status', '').lower()
if status.find('not installed') > -1 or status.find('out-of-date') > -1:
ret[name] = pkg_info.get('version')
else:
ret[name] = ''
# Return a string if only one package name passed
if len(names) == 1 and len(ret):