Fixing file writing format

reviewable/pr18780/r1
GGabriele 8 years ago
parent 4180d10684
commit 9bef6f6597

@ -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