Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
582259f9
Commit
582259f9
authored
Apr 27, 2015
by
Toshio Kuratomi
Committed by
James Cammarata
Apr 27, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Applying
c9fb97cc
(permissions on symlink fix) to v2
parent
0303d9ce
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
v2/ansible/module_utils/basic.py
+15
-4
No files found.
v2/ansible/module_utils/basic.py
View file @
582259f9
...
...
@@ -31,7 +31,7 @@
ANSIBLE_VERSION
=
"<<ANSIBLE_VERSION>>"
MODULE_ARGS
=
""
MODULE_ARGS
=
"
<<INCLUDE_ANSIBLE_MODULE_ARGS>>
"
MODULE_COMPLEX_ARGS
=
"<<INCLUDE_ANSIBLE_MODULE_COMPLEX_ARGS>>"
BOOLEANS_TRUE
=
[
'yes'
,
'on'
,
'1'
,
'true'
,
1
]
...
...
@@ -657,14 +657,25 @@ class AnsibleModule(object):
# FIXME: comparison against string above will cause this to be executed
# every time
try
:
if
'lchmod'
in
dir
(
os
):
if
hasattr
(
os
,
'lchmod'
):
os
.
lchmod
(
path
,
mode
)
else
:
os
.
chmod
(
path
,
mode
)
if
not
os
.
path
.
islink
(
path
):
os
.
chmod
(
path
,
mode
)
else
:
# Attempt to set the perms of the symlink but be
# careful not to change the perms of the underlying
# file while trying
underlying_stat
=
os
.
stat
(
path
)
os
.
chmod
(
path
,
mode
)
new_underlying_stat
=
os
.
stat
(
path
)
if
underlying_stat
.
st_mode
!=
new_underlying_stat
.
st_mode
:
os
.
chmod
(
path
,
stat
.
S_IMODE
(
underlying_stat
.
st_mode
))
q_stat
=
os
.
stat
(
path
)
except
OSError
,
e
:
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
elif
e
.
errno
in
(
errno
.
ENOENT
,
errno
.
ELOOP
)
:
# Can't set mode on broken symbolic links
pass
else
:
raise
e
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment