Skip to content

Commit 392fd0d

Browse files
committed
fix(acl): correctly assert needed changes when recursive is true
1 parent 1994b2c commit 392fd0d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
bugfixes:
2+
- acl - correctly assert needed changes when pointing to a directory and recursive is set to true.

plugins/modules/acl.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -243,13 +243,19 @@ def acl_changed(module, cmd, entry, use_nfsv4_acls=False):
243243
cmd.insert(1, '--test')
244244
lines = run_acl(module, cmd)
245245
counter = 0
246+
lines_checked = 0
247+
lines_unchanged = 0
246248
for line in lines:
249+
lines_checked += 1
247250
if line.endswith('*,*') and not use_nfsv4_acls:
248-
return False
251+
lines_unchanged += 1
249252
# if use_nfsv4_acls and entry is listed
250253
if use_nfsv4_acls and entry == line:
251254
counter += 1
252255

256+
if lines_unchanged == lines_checked:
257+
return False
258+
253259
# The current 'nfs4_setfacl --test' lists a new entry,
254260
# which will be added at the top of list, followed by the existing entries.
255261
# So if the entry has already been registered, the entry should be find twice.

0 commit comments

Comments
 (0)