mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Added single package return for latest_version, fixed other bug.
This commit is contained in:
parent
d93ad103c7
commit
5cdb15c9e3
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user