Commit 0ce99e39 by WAKAYAMA Shirou

fix: if a path is symlink and trying to chmod, OSError Exception will be raised.

parent d1effecb
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment