diff --git a/salt/modules/win_pkg.py b/salt/modules/win_pkg.py index 140b20e30b..3d3760346d 100644 --- a/salt/modules/win_pkg.py +++ b/salt/modules/win_pkg.py @@ -137,15 +137,27 @@ def list_available(*names): CLI Example:: salt '*' pkg.list_available + salt '*' pkg.list_available ''' + 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):