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
58a23bc6
Commit
58a23bc6
authored
Jul 28, 2014
by
Michael DeHaan
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7968 from bcoca/acl_fix_compare
acl module: now compares permissions correctly
parents
6caad9ac
e1d57d88
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
library/files/acl
+13
-10
No files found.
library/files/acl
View file @
58a23bc6
...
...
@@ -102,6 +102,17 @@ EXAMPLES = '''
register: acl_info
'''
def
normalize_permissions
(
p
):
perms
=
[
'-'
,
'-'
,
'-'
]
for
char
in
p
:
if
char
==
'r'
:
perms
[
0
]
=
'r'
if
char
==
'w'
:
perms
[
1
]
=
'w'
if
char
==
'x'
:
perms
[
2
]
=
'x'
return
''
.
join
(
perms
)
def
split_entry
(
entry
):
''' splits entry and ensures normalized return'''
...
...
@@ -129,15 +140,7 @@ def split_entry(entry):
else
:
t
=
None
perms
=
[
'-'
,
'-'
,
'-'
]
for
char
in
p
:
if
char
==
'r'
:
perms
[
0
]
=
'r'
if
char
==
'w'
:
perms
[
1
]
=
'w'
if
char
==
'x'
:
perms
[
2
]
=
'x'
p
=
''
.
join
(
perms
)
p
=
normalize_permissions
(
p
)
return
[
d
,
t
,
e
,
p
]
...
...
@@ -208,7 +211,7 @@ def main():
entry
=
module
.
params
.
get
(
'entry'
)
entity
=
module
.
params
.
get
(
'entity'
)
etype
=
module
.
params
.
get
(
'etype'
)
permissions
=
module
.
params
.
get
(
'permissions'
)
permissions
=
normalize_permissions
(
module
.
params
.
get
(
'permissions'
)
)
state
=
module
.
params
.
get
(
'state'
)
follow
=
module
.
params
.
get
(
'follow'
)
default
=
module
.
params
.
get
(
'default'
)
...
...
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