mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #52209 from twangboy/fix_choco_retcode
Handle Chocolatey's new Enhanced Exit Codes
This commit is contained in:
commit
262516c63a
1 changed files with 6 additions and 1 deletions
|
@ -291,7 +291,12 @@ def list_(narrow=None,
|
|||
|
||||
result = __salt__['cmd.run_all'](cmd, python_shell=False)
|
||||
|
||||
if result['retcode'] != 0:
|
||||
# Chocolatey introduced Enhanced Exit Codes starting with version 0.10.12
|
||||
# Exit Code 2 means there were no results, but is not a failure
|
||||
# This may start to effect other functions in the future as Chocolatey
|
||||
# moves more functions to this new paradigm
|
||||
# https://github.com/chocolatey/choco/issues/1758
|
||||
if result['retcode'] not in [0, 2]:
|
||||
raise CommandExecutionError(
|
||||
'Running chocolatey failed: {0}'.format(result['stdout'])
|
||||
)
|
||||
|
|
Loading…
Add table
Reference in a new issue