mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Return locally installed version if no newer is available
This commit is contained in:
parent
2d91584ee8
commit
75fd92fd98
@ -78,6 +78,14 @@ def latest_version(*names, **kwargs):
|
||||
except (ValueError, IndexError):
|
||||
pass
|
||||
|
||||
pkgs = {}
|
||||
|
||||
for name in names:
|
||||
if not ret[name]:
|
||||
if not pkgs:
|
||||
pkgs = list_pkgs()
|
||||
if name in pkgs:
|
||||
ret[name] = pkgs[name]
|
||||
# Return a string if only one package name passed
|
||||
if len(names) == 1:
|
||||
return ret[names[0]]
|
||||
|
Loading…
Reference in New Issue
Block a user