mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Accounting for certain situations when the query result is not a string, but actually a dictionary.
This commit is contained in:
parent
152c09cc0c
commit
a040643a82
1 changed files with 11 additions and 3 deletions
|
@ -353,9 +353,17 @@ def run(name,
|
|||
)
|
||||
)
|
||||
else:
|
||||
output_file.write(
|
||||
salt.utils.stringutils.to_str(query_result)
|
||||
)
|
||||
if isinstance(query_result, six.text_type):
|
||||
output_file.write(
|
||||
salt.utils.stringutils.to_str(query_result)
|
||||
)
|
||||
else:
|
||||
for col, val in six.iteritems(query_result):
|
||||
output_file.write(
|
||||
salt.utils.stringutils.to_str(
|
||||
'{0}:{1}\n'.format(col, val)
|
||||
)
|
||||
)
|
||||
else:
|
||||
ret['changes']['query'] = "Executed"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue