mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
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:
parent
cdbd2fbe3c
commit
1f5fc17551
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue