Support multiple package names.

This commit is contained in:
David Boucha 2013-05-01 12:35:37 -06:00
parent 43b46455f1
commit 7f239aa7bd

View File

@ -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):