Use machine readable output for list

This actually fixes the issue in #38290 while the other change should improve the output for the states.
This commit is contained in:
dragon788 2016-12-15 16:57:58 -06:00 committed by Ethan Spoelstra
parent cdbd2fbe3c
commit 1f5fc17551

View file

@ -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)
@ -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