Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not downcase acl group/user names when checking for insync?. #25

Merged
merged 2 commits into from
Oct 4, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ group :development, :unit_tests do
gem 'puppetlabs_spec_helper', :require => false
gem 'simplecov', :require => false
gem 'puppet_facts', :require => false
gem 'json', :require => false
gem "json", '~> 1.8.3', :require => false
gem "json_pure", '~> 1.8.3', :require => false
gem 'metadata-json-lint', :require => false
gem "rake", '< 11.0.0', :require => false
end

group :system_tests do
Expand Down
14 changes: 6 additions & 8 deletions lib/puppet/type/acl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,8 @@ def unset_insync(cur_perm)
end

def set_insync(cur_perm)
# Puppet.debug "permission.set_insync"
test_should = @should.map { |x| x.downcase() }.uniq
(cur_perm.sort == test_should.sort) or (provider.check_set and ((test_should - cur_perm).length == 0))
should = @should.uniq.sort
(cur_perm.sort == should) or (provider.check_set and ((should - cur_perm).length == 0))
end

def purge_insync(cur_perm)
Expand All @@ -174,15 +173,14 @@ def purge_insync(cur_perm)
end

def insync?(is)
cur_perm = provider.permission
Puppet.debug "permission.insync? cur_perm: #{cur_perm.inspect} @should: #{@should.inspect}"
Puppet.debug "permission.insync? is: #{is.inspect} @should: #{@should.inspect}"
if provider.check_purge
return purge_insync(cur_perm)
return purge_insync(is)
end
if provider.check_unset
return unset_insync(cur_perm)
return unset_insync(is)
end
return set_insync(cur_perm)
return set_insync(is)
end

# Munge into normalised form
Expand Down