Merge pull request #20200 from techhat/decodeout

Allow writing decoded data to file
This commit is contained in:
C. R. Oldham 2015-01-29 11:00:10 -07:00
commit d3524e9291

View File

@ -85,6 +85,7 @@ def query(url,
verify_ssl=None,
text_out=None,
headers_out=None,
decode_out=None,
**kwargs):
'''
Query a resource, and decode the return data
@ -325,6 +326,10 @@ def query(url,
else:
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:
ret['text'] = result_text