mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
Convert the network subfolder to py3/py2.4 syntax (#3690)
This commit is contained in:
parent
09066f1518
commit
c0217e14a7
20 changed files with 90 additions and 47 deletions
|
@ -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)))
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue