Fixing file writing format

pull/18777/head
GGabriele 8 years ago committed by Matt Clay
parent 2016e5d44a
commit 4775c257ea

@ -561,8 +561,9 @@ def write_on_file(content, filename, module):
path += '/' path += '/'
filepath = '{0}{1}'.format(path, filename) filepath = '{0}{1}'.format(path, filename)
try: try:
with open(filepath, 'w') as report: report = open(filepath, 'w')
report.write(content) report.write(content)
report.close()
except: except:
module.fail_json(msg="Error while writing on file.") module.fail_json(msg="Error while writing on file.")

Loading…
Cancel
Save