mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-11 08:34:21 -07:00
Merge pull request #3638 from shirou/devel
fix: if a path is symlink and trying to chmod, OSError Exception will be raised
This commit is contained in:
commit
b2d2c40538
1 changed files with 3 additions and 1 deletions
|
@ -435,7 +435,9 @@ class AnsibleModule(object):
|
|||
else:
|
||||
os.chmod(path, mode)
|
||||
except OSError, e:
|
||||
if e.errno == errno.ENOENT: # Can't set mode on broken symbolic links
|
||||
if os.path.islink(path) and e.errno == errno.EPERM: # Can't set mode on symbolic links
|
||||
pass
|
||||
elif e.errno == errno.ENOENT: # Can't set mode on broken symbolic links
|
||||
pass
|
||||
else:
|
||||
raise e
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue