mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #35559 from Jlin317/fix_highstate_outputter
Fix highstate outputter when it's given multiple results
This commit is contained in:
commit
bec8322e13
1 changed files with 9 additions and 6 deletions
|
@ -130,12 +130,15 @@ def output(data):
|
|||
if 'data' in data:
|
||||
data = data.pop('data')
|
||||
|
||||
for host, hostdata in six.iteritems(data):
|
||||
if not isinstance(hostdata, dict):
|
||||
# Highstate return data must be a dict, if this is not the case
|
||||
# then this value is likely a retcode.
|
||||
continue
|
||||
return _format_host(host, hostdata)[0]
|
||||
ret = [
|
||||
_format_host(host, hostdata)[0]
|
||||
for host, hostdata in six.iteritems(data)
|
||||
# Highstate return data must be a dict, if this is not the case
|
||||
# then this value is likely a retcode.
|
||||
if isinstance(hostdata, dict)
|
||||
]
|
||||
if ret:
|
||||
return "\n".join(ret)
|
||||
log.error(
|
||||
'Data passed to highstate outputter is not a valid highstate return: %s',
|
||||
data
|
||||
|
|
Loading…
Add table
Reference in a new issue