1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

fixed py3 compatibility

This commit is contained in:
Brian Coca 2016-02-04 13:14:56 -05:00
parent 70ac47ae61
commit 89c57666c3

View file

@ -1722,7 +1722,8 @@ class AnsibleModule(object):
out_dest.close()
if in_src:
in_src.close()
except (shutil.Error, OSError, IOError), e:
except (shutil.Error, OSError, IOError):
e = get_exception()
self.fail_json(msg='Could not write data to file (%s) from (%s): %s' % (dest, src, e))
elif e.errno not in [errno.EPERM, errno.EXDEV, errno.EACCES, errno.ETXTBSY]:
# only try workarounds for errno 18 (cross device), 1 (not permitted), 13 (permission denied)