mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Added limit-output to eliminate false packages
This should fix #38290 and maybe others.
This commit is contained in:
parent
9e78ddc80e
commit
cdbd2fbe3c
1 changed files with 2 additions and 2 deletions
|
@ -86,7 +86,7 @@ def installed(name, version=None, source=None, force=False, pre_versions=False,
|
|||
'comment': ''}
|
||||
|
||||
# Determine if the package is installed
|
||||
if name not in __salt__['cmd.run']('choco list --local-only'):
|
||||
if name not in __salt__['cmd.run']('choco list --local-only --limit-output'):
|
||||
ret['changes'] = {'name': '{0} will be installed'.format(name)}
|
||||
elif force:
|
||||
ret['changes'] = {'name': '{0} is already installed but will reinstall'
|
||||
|
@ -166,7 +166,7 @@ def uninstalled(name, version=None, uninstall_args=None, override_args=False):
|
|||
'comment': ''}
|
||||
|
||||
# Determine if package is installed
|
||||
if name in __salt__['cmd.run']('choco list --local-only'):
|
||||
if name in __salt__['cmd.run']('choco list --local-only --limit-output'):
|
||||
ret['changes'] = {'name': '{0} will be removed'.format(name)}
|
||||
else:
|
||||
ret['comment'] = 'The package {0} is not installed'.format(name)
|
||||
|
|
Loading…
Add table
Reference in a new issue