mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Convert the network subfolder to py3/py2.4 syntax (#3690)
This commit is contained in:
committed by
Matt Clay
parent
09066f1518
commit
c0217e14a7
@@ -220,7 +220,8 @@ def write_file(module, url, dest, content):
|
||||
f = open(tmpsrc, 'wb')
|
||||
try:
|
||||
f.write(content)
|
||||
except Exception, err:
|
||||
except Exception:
|
||||
err = get_exception()
|
||||
os.remove(tmpsrc)
|
||||
module.fail_json(msg="failed to create temporary content file: %s" % str(err))
|
||||
f.close()
|
||||
@@ -255,7 +256,8 @@ def write_file(module, url, dest, content):
|
||||
if checksum_src != checksum_dest:
|
||||
try:
|
||||
shutil.copyfile(tmpsrc, dest)
|
||||
except Exception, err:
|
||||
except Exception:
|
||||
err = get_exception()
|
||||
os.remove(tmpsrc)
|
||||
module.fail_json(msg="failed to copy %s to %s: %s" % (tmpsrc, dest, str(err)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user