Handle mode-setting of symlink to RO filesystem (#58564)

Fix for https://github.com/ansible/ansible/issues/58562
This commit is contained in:
dpoon 2019-07-02 08:15:39 -07:00 committed by Brian Coca
parent 6e9bcc2579
commit a9fcd1d197

View file

@ -1114,7 +1114,7 @@ class AnsibleModule(object):
if underlying_stat.st_mode != new_underlying_stat.st_mode:
os.chmod(b_path, stat.S_IMODE(underlying_stat.st_mode))
except OSError as e:
if os.path.islink(b_path) and e.errno == errno.EPERM: # Can't set mode on symbolic links
if os.path.islink(b_path) and e.errno in (errno.EPERM, errno.EROFS): # Can't set mode on symbolic links
pass
elif e.errno in (errno.ENOENT, errno.ELOOP): # Can't set mode on broken symbolic links
pass