Convert the network subfolder to py3/py2.4 syntax (#3690)

This commit is contained in:
Michael Scherer 2016-05-18 18:08:30 +02:00 committed by Matt Clay
commit c0217e14a7
20 changed files with 90 additions and 47 deletions

View file

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