mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-24 13:50: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
|
@ -225,7 +225,8 @@ def url_get(module, url, dest, use_proxy, last_mod_time, force, timeout=10, head
|
|||
f = os.fdopen(fd, 'wb')
|
||||
try:
|
||||
shutil.copyfileobj(rsp, f)
|
||||
except Exception, err:
|
||||
except Exception:
|
||||
err = get_exception()
|
||||
os.remove(tempname)
|
||||
module.fail_json(msg="failed to create temporary content file: %s" % str(err))
|
||||
f.close()
|
||||
|
@ -391,7 +392,8 @@ def main():
|
|||
if os.path.exists(dest):
|
||||
backup_file = module.backup_local(dest)
|
||||
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)))
|
||||
changed = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue