Fix spelling typo, and fix backwards campatible minion option for repo location

This commit is contained in:
Damon Atkins 2017-12-07 00:54:16 +11:00
parent 88c0d66b4e
commit 7c7e21f94d

View File

@ -194,6 +194,7 @@ def upgrade_available(name, **kwargs):
# Refresh before looking for the latest version available,
# same default as latest_version
refresh = salt.utils.is_true(kwargs.get('refresh', True))
# if latest_version returns blank, the latest version is already installed or
# their is no package definition. This is a salt standard which could be improved.
return latest_version(name, saltenv=saltenv, refresh=refresh) != ''
@ -313,10 +314,9 @@ def version(*names, **kwargs):
refresh (bool): Refresh package metadata. Default ``False``.
Returns:
str: version string when a single packge is specified.
str: version string when a single package is specified.
dict: The package name(s) with the installed versions.
.. code-block:: cfg
{['<version>', '<version>', ]} OR
{'<package name>': ['<version>', '<version>', ]}
@ -330,13 +330,13 @@ def version(*names, **kwargs):
'''
# Standard is return empty string even if not a valid name
# TODO: Look at returning an error accross all platforms with
# TODO: Look at returning an error across all platforms with
# CommandExecutionError(msg,info={'errors': errors })
# available_pkgs = get_repo_data(saltenv).get('repo')
# for name in names:
# if name in available_pkgs:
# ret[name] = installed_pkgs.get(name, '')
#
saltenv = kwargs.get('saltenv', 'base')
installed_pkgs = list_pkgs(saltenv=saltenv, refresh=kwargs.get('refresh', False))
@ -643,7 +643,7 @@ def _get_repo_details(saltenv):
else:
winrepo_source_dir = __opts__['winrepo_source_dir']
# winrepo_source_dir = __opts__['winrepo_source_dir']
winrepo_source_dir = __opts__['winrepo_source_dir']
dirs = [__opts__['cachedir'], 'files', saltenv]
url_parts = _urlparse(winrepo_source_dir)
dirs.append(url_parts.netloc)
@ -1616,6 +1616,8 @@ def remove(name=None, pkgs=None, version=None, **kwargs):
cached_pkg = cached_pkg.replace('/', '\\')
cache_path, _ = os.path.split(cached_pkg)
# os.path.expandvars is not required as we run everything through cmd.exe /s /c
# Get uninstall flags
uninstall_flags = pkginfo[target].get('uninstall_flags', '')
@ -1626,7 +1628,9 @@ def remove(name=None, pkgs=None, version=None, **kwargs):
# Compute msiexec string
use_msiexec, msiexec = _get_msiexec(pkginfo[target].get('msiexec', False))
cmd_shell = os.getenv('ComSpec', '{0}\\system32\\cmd.exe'.format(os.getenv('WINDIR')))
# Build Scheduled Task Parameters
# Build cmd and arguments
# cmd and arguments must be separated for use with the task scheduler
if use_msiexec:
# Check if uninstaller is set to {guid}, if not we assume its a remote msi file.
# which has already been downloaded.