mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #20200 from techhat/decodeout
Allow writing decoded data to file
This commit is contained in:
commit
d3524e9291
@ -85,6 +85,7 @@ def query(url,
|
|||||||
verify_ssl=None,
|
verify_ssl=None,
|
||||||
text_out=None,
|
text_out=None,
|
||||||
headers_out=None,
|
headers_out=None,
|
||||||
|
decode_out=None,
|
||||||
**kwargs):
|
**kwargs):
|
||||||
'''
|
'''
|
||||||
Query a resource, and decode the return data
|
Query a resource, and decode the return data
|
||||||
@ -325,6 +326,10 @@ def query(url,
|
|||||||
else:
|
else:
|
||||||
text = True
|
text = True
|
||||||
|
|
||||||
|
if os.path.exists(decode_out):
|
||||||
|
with salt.utils.fopen(decode_out, 'w') as dof:
|
||||||
|
dof.write(result_text)
|
||||||
|
|
||||||
if text is True:
|
if text is True:
|
||||||
ret['text'] = result_text
|
ret['text'] = result_text
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user