Skip to content

Commit

Permalink
Use machine readable output for list
Browse files Browse the repository at this point in the history
This actually fixes the issue in saltstack#38290 while the other change should improve the output for the states.
  • Loading branch information
dragon788 authored and Ethan Spoelstra committed Dec 16, 2016
1 parent cdbd2fb commit 1f5fc17
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion salt/modules/chocolatey.py
Expand Up @@ -255,6 +255,7 @@ def list_(narrow=None,
cmd.extend(['-source', source])
if local_only:
cmd.extend(['-localonly'])
cmd.extend(['-limitoutput'])

result = __salt__['cmd.run_all'](cmd, python_shell=False)

Expand All @@ -264,7 +265,7 @@ def list_(narrow=None,
raise CommandExecutionError(err)

ret = {}
pkg_re = re.compile(r'(\S+)\s+(\S+)')
pkg_re = re.compile(r'(\S+)\|(\S+)')
for line in result['stdout'].split('\n'):
if line.startswith("No packages"):
return ret
Expand Down

0 comments on commit 1f5fc17

Please sign in to comment.