Skip to content

Commit

Permalink
Add more debug statements to provider
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jan 25, 2022
1 parent aa7c8f7 commit 6755c8f
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/puppet/provider/posix_acl/posixacl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def exists?
end

def unset_perm(perm, path)
Puppet.debug "unset_perm: called with perm: '#{perm}' and path: '#{path}'"
# Don't try to unset mode bits, it doesn't make sense!
return if perm =~ %r{^(((u(ser)?)|(g(roup)?)|(m(ask)?)|(o(ther)?)):):}

Expand All @@ -31,13 +32,15 @@ def unset_perm(perm, path)
end

def set_perm(perm_set, path)
Puppet.debug "set_perm: called with perm_set: '#{perm_set}' and path: '#{path}'"
args_list = ['-n']
args_list << '-R' if check_recursive
perm_set.each do |perm|
args_list << '-m'
args_list << perm
end
args_list << path
Puppet.debug "calling setfacl with args_list: #{args_list}"
setfacl(args_list)
end

Expand Down Expand Up @@ -89,15 +92,18 @@ def check_set
end

# TODO: Investigate why we're not using this parameter
def permission=(_value)
Puppet.debug @resource.value(:action)
def permission=(value)
Puppet.debug "resource.value(:action): #{@resource.value(:action)}"
Puppet.debug "value parameter for permission method is: #{value}"
Puppet.debug "new permissions from the instance are: #{@resource.value(:permission)}"
case @resource.value(:action)
when :unset
unset
when :purge
purge
when :exact, :set
cur_perm = permission
Puppet.debug "current permissions are: #{permission}"
new_perm = @resource.value(:permission)
# For comparison purposes, we want to change X to x as it's only useful
# for setfacl and isn't stored or noted by getfacl.
Expand Down

0 comments on commit 6755c8f

Please sign in to comment.