mirror of
https://github.com/valitydev/salt.git
synced 2024-11-06 16:45:27 +00:00
Support multiple package names.
This commit is contained in:
parent
43b46455f1
commit
7f239aa7bd
@ -137,15 +137,27 @@ def list_available(*names):
|
||||
CLI Example::
|
||||
|
||||
salt '*' pkg.list_available <package name>
|
||||
salt '*' pkg.list_available <package name01> <package name02>
|
||||
'''
|
||||
if not names:
|
||||
return ''
|
||||
if len(names) == 1:
|
||||
versions = list()
|
||||
versions = []
|
||||
pkginfo = _get_package_info(names[0])
|
||||
if not pkginfo:
|
||||
return ''
|
||||
for version in pkginfo.keys():
|
||||
versions.append(version)
|
||||
return versions
|
||||
if len(names) > 1:
|
||||
versions = {}
|
||||
for name in names:
|
||||
pkginfo = _get_package_info(name)
|
||||
versions[name] = []
|
||||
if not pkginfo:
|
||||
continue
|
||||
for version in pkginfo.keys():
|
||||
versions[name].append(version)
|
||||
return versions
|
||||
|
||||
|
||||
def version(*names, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user