diff --git a/network/nxos/nxos_snapshot.py b/network/nxos/nxos_snapshot.py index 54a4ae965b4..f99c2ed294d 100644 --- a/network/nxos/nxos_snapshot.py +++ b/network/nxos/nxos_snapshot.py @@ -561,9 +561,9 @@ def write_on_file(content, filename, module): path += '/' filepath = '{0}{1}'.format(path, filename) try: - report = open(filepath, 'w') - report.write(content) - report.close() + report = open(filepath, 'w') + report.write(content) + report.close() except: module.fail_json(msg="Error while writing on file.")