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
6874d853
Commit
6874d853
authored
Mar 15, 2012
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix changed=True/False detection when specifying mode=
parent
63818000
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
library/file
+10
-4
No files found.
library/file
View file @
6874d853
...
...
@@ -157,16 +157,22 @@ def set_mode_if_different(path, mode, changed):
fail_json
(
path
=
path
,
msg
=
'mode needs to be something octalish'
,
details
=
str
(
e
))
st
=
os
.
stat
(
path
)
actual
_mode
=
stat
.
S_IMODE
(
st
[
stat
.
ST_MODE
])
prev
_mode
=
stat
.
S_IMODE
(
st
[
stat
.
ST_MODE
])
if
actual_mode
!=
mode
:
if
prev_mode
!=
mode
:
# FIXME: comparison against string above will cause this to be executed
# every time
try
:
debug
(
'setting mode'
)
os
.
chmod
(
path
,
mode
)
except
Exception
,
e
:
fail_json
(
path
=
path
,
msg
=
'chmod failed'
,
details
=
str
(
e
))
if
os
.
path
.
exists
(
path
):
return
True
st
=
os
.
stat
(
path
)
new_mode
=
stat
.
S_IMODE
(
st
[
stat
.
ST_MODE
])
if
new_mode
!=
prev_mode
:
return
True
return
changed
def
rmtree_error
(
func
,
path
,
exc_info
):
...
...
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