Added single package return for latest_version, fixed other bug.

This commit is contained in:
justinta89 2015-10-21 15:11:40 -06:00
parent d93ad103c7
commit 5cdb15c9e3

View File

@ -162,8 +162,6 @@ def info_available(*names, **kwargs):
if nfo.get("name"):
name = nfo.pop("name")
ret[name] = nfo
if nfo.get("status"):
nfo['status'] = nfo.get("status").split(" ")[0]
if nfo.get("installed"):
nfo['installed'] = nfo.get("installed").lower() == "yes" and True or False
@ -214,7 +212,11 @@ def latest_version(*names, **kwargs):
for name in names:
pkg_info = package_info.get(name, {})
if pkg_info.get('status', '').lower() in ['not installed', 'out-of-date']:
ret[name] = pkg_info
ret[name] = pkg_info.get('version')
# Return a string if only one package name passed
if len(names) == 1 and len(ret):
return ret[names[0]]
return ret