mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Make sure we exit out correctly when checking for choco version
This commit is contained in:
parent
157e0f446d
commit
0076d73872
1 changed files with 6 additions and 2 deletions
|
@ -120,12 +120,16 @@ def chocolatey_version():
|
|||
return __context__['chocolatey._version']
|
||||
except Exception:
|
||||
pass
|
||||
return None
|
||||
|
||||
# First try to find if we have a newer version of choco
|
||||
# which doesn't contain the help command,
|
||||
# else try for a legacy version
|
||||
find_version(legacy=False)
|
||||
find_version(legacy=True)
|
||||
for legacy in [False, True]:
|
||||
ver = find_version(legacy=legacy)
|
||||
if ver is not None:
|
||||
return ver
|
||||
|
||||
raise CommandExecutionError('Unable to determine Chocolatey version')
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue