mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #48164 from garethgreenaway/48146_mysql_output_to_file
[2018.3] Fixes to mysql state
This commit is contained in:
commit
60c9490bdc
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