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:
parent
70ac47ae61
commit
89c57666c3
1 changed files with 3 additions and 2 deletions
|
@ -1722,8 +1722,9 @@ class AnsibleModule(object):
|
||||||
out_dest.close()
|
out_dest.close()
|
||||||
if in_src:
|
if in_src:
|
||||||
in_src.close()
|
in_src.close()
|
||||||
except (shutil.Error, OSError, IOError), e:
|
except (shutil.Error, OSError, IOError):
|
||||||
self.fail_json(msg='Could not write data to file (%s) from (%s): %s' % (dest, src, e))
|
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]:
|
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)
|
# only try workarounds for errno 18 (cross device), 1 (not permitted), 13 (permission denied)
|
||||||
# and 26 (text file busy) which happens on vagrant synced folders and other 'exotic' non posix file systems
|
# and 26 (text file busy) which happens on vagrant synced folders and other 'exotic' non posix file systems
|
||||||
|
|
Loading…
Reference in a new issue