From af9fdf8330b1c438fb99bcc18da178fda2641d7f Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 15 Dec 2021 20:50:04 +0100 Subject: [PATCH 01/10] modulesync 5.1.0 --- .msync.yml | 2 +- .puppet-lint.rc | 3 +++ Gemfile | 4 ++-- Rakefile | 2 +- spec/spec_helper.rb | 10 +++++----- 5 files changed, 12 insertions(+), 9 deletions(-) create mode 100644 .puppet-lint.rc diff --git a/.msync.yml b/.msync.yml index 43966c2..a83abd9 100644 --- a/.msync.yml +++ b/.msync.yml @@ -2,4 +2,4 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -modulesync_config_version: '4.2.0' +modulesync_config_version: '5.1.0' diff --git a/.puppet-lint.rc b/.puppet-lint.rc new file mode 100644 index 0000000..dd8272c --- /dev/null +++ b/.puppet-lint.rc @@ -0,0 +1,3 @@ +--fail-on-warnings +--no-parameter_documentation-check +--no-parameter_types-check diff --git a/Gemfile b/Gemfile index a39114c..b6dcf45 100644 --- a/Gemfile +++ b/Gemfile @@ -4,7 +4,7 @@ source ENV['GEM_SOURCE'] || "https://rubygems.org" group :test do - gem 'voxpupuli-test', '~> 2.5', :require => false + gem 'voxpupuli-test', '~> 5.0', :require => false gem 'coveralls', :require => false gem 'simplecov-console', :require => false gem 'puppet_metadata', '~> 1.0', :require => false @@ -21,7 +21,7 @@ end group :release do gem 'github_changelog_generator', '>= 1.16.1', :require => false if RUBY_VERSION >= '2.5' - gem 'voxpupuli-release', '>= 1.0.2', :require => false + gem 'voxpupuli-release', '>= 1.2.0', :require => false gem 'puppet-strings', '>= 2.2', :require => false end diff --git a/Rakefile b/Rakefile index 80b799d..f92f051 100644 --- a/Rakefile +++ b/Rakefile @@ -1,7 +1,7 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -# Attempt to load voxupuli-test (which pulls in puppetlabs_spec_helper), +# Attempt to load voxpupuli-test (which pulls in puppetlabs_spec_helper), # otherwise attempt to load it directly. begin require 'voxpupuli/test/rake' diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fb5f0cb..4d617f3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,17 +1,17 @@ +# frozen_string_literal: true + # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ # puppetlabs_spec_helper will set up coverage if the env variable is set. # We want to do this if lib exists and it hasn't been explicitly set. -ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../../lib', __FILE__)) +ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__)) require 'voxpupuli/test/spec_helper' if File.exist?(File.join(__dir__, 'default_module_facts.yml')) facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) - if facts - facts.each do |name, value| - add_custom_fact name.to_sym, value - end + facts&.each do |name, value| + add_custom_fact name.to_sym, value end end From 7f343e56e25bd001cb5af14a8db50d0839b467bf Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 09:49:27 +0100 Subject: [PATCH 02/10] rubocop: safe autocorrect --- lib/puppet/provider/posix_acl/posixacl.rb | 4 +++- lib/puppet/type/posix_acl.rb | 23 +++++++++---------- spec/unit/puppet/provider/posixacl_spec.rb | 2 ++ spec/unit/puppet/type/acl_spec.rb | 26 +++++++++++++++++++++- 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/lib/puppet/provider/posix_acl/posixacl.rb b/lib/puppet/provider/posix_acl/posixacl.rb index e09a87b..375f018 100644 --- a/lib/puppet/provider/posix_acl/posixacl.rb +++ b/lib/puppet/provider/posix_acl/posixacl.rb @@ -10,7 +10,7 @@ end confine feature: :posix - defaultfor osfamily: [:debian, :redhat, :suse, :gentoo] + defaultfor osfamily: %i[debian redhat suse gentoo] def exists? permission @@ -55,6 +55,7 @@ def purge def permission return [] unless File.exist?(@resource.value(:path)) + value = [] # String#lines would be nice, but we need to support Ruby 1.8.5 getfacl('--absolute-names', '--no-effective', @resource.value(:path)).split("\n").each do |line| @@ -105,6 +106,7 @@ def permission=(_value) # TODO: Investigate why we're not using this parameter perm_to_unset = cur_perm - new_perm perm_to_unset_check = lc_cur_perm - lc_new_perm return false if perm_to_set_check.empty? && perm_to_unset_check.empty? + # Take supplied perms literally, unset any existing perms which # are absent from ACLs given if check_exact diff --git a/lib/puppet/type/posix_acl.rb b/lib/puppet/type/posix_acl.rb index 46c62d1..a2b9fb0 100644 --- a/lib/puppet/type/posix_acl.rb +++ b/lib/puppet/type/posix_acl.rb @@ -39,7 +39,7 @@ file { '/var/www/html': mode => 754, } - EOT + EOT newparam(:action) do desc 'What do we do with this list of ACLs? Options are set, unset, exact, and purge' @@ -52,9 +52,7 @@ isnamevar validate do |value| path = Pathname.new(value) - unless path.absolute? - raise ArgumentError, "Path must be absolute: #{path}" - end + raise ArgumentError, "Path must be absolute: #{path}" unless path.absolute? end end @@ -79,7 +77,7 @@ def self.descendant?(a, b) end # Snippet based on upstream Puppet (ASL 2.0) - [:posix_acl, :file].each do |autorequire_type| + %i[posix_acl file].each do |autorequire_type| autorequire(autorequire_type) do req = [] path = Pathname.new(self[:path]) @@ -103,7 +101,6 @@ def self.descendant?(a, b) end req end - # rubocop:enable Style/MultilineBlockChain end # End of Snippet @@ -182,6 +179,7 @@ def insync?(is) Puppet.debug "permission.insync? is: #{is.inspect} @should: #{@should.inspect}" return purge_insync(is) if provider.check_purge return unset_insync(is) if provider.check_unset + set_insync(is) end @@ -191,9 +189,11 @@ def insync?(is) a = acl.split ':', -1 # -1 keeps trailing empty fields. raise ArgumentError, "Too few fields. At least 3 required, got #{a.length}." if a.length < 3 raise ArgumentError, "Too many fields. At most 4 allowed, got #{a.length}." if a.length > 4 + if a.length == 4 d = a.shift raise ArgumentError, %(First field of 4 must be "d" or "default", got "#{d}".) unless %w[d default].include?(d) + r << 'default:' end t = a.shift # Copy the type. @@ -240,10 +240,8 @@ def self.pick_default_perms(acl) def newchild(path) options = @original_parameters.merge(name: path).reject { |_param, value| value.nil? } - unless File.directory?(options[:name]) - options[:permission] = self.class.pick_default_perms(options[:permission]) if options.include?(:permission) - end - [:recursive, :recursemode, :path].each do |param| + options[:permission] = self.class.pick_default_perms(options[:permission]) if !File.directory?(options[:name]) && options.include?(:permission) + %i[recursive recursemode path].each do |param| options.delete(param) if options.include?(param) end self.class.new(options) @@ -251,6 +249,7 @@ def newchild(path) def generate return [] unless self[:recursive] == :true && self[:recursemode] == :deep + results = [] paths = Set.new if File.directory?(self[:path]) @@ -275,8 +274,6 @@ def generate end validate do - unless self[:permission] - raise(Puppet::Error, 'permission is a required property.') - end + raise(Puppet::Error, 'permission is a required property.') unless self[:permission] end end diff --git a/spec/unit/puppet/provider/posixacl_spec.rb b/spec/unit/puppet/provider/posixacl_spec.rb index ae42ad9..2914ed0 100644 --- a/spec/unit/puppet/provider/posixacl_spec.rb +++ b/spec/unit/puppet/provider/posixacl_spec.rb @@ -9,11 +9,13 @@ provider_class.command :getfacl end.not_to raise_error end + it 'declares a setfacl command' do expect do provider_class.command :setfacl end.not_to raise_error end + it 'encodes spaces in group names' do RSpec::Mocks.with_temporary_scope do allow(Puppet::Type).to receive(:getfacl).and_return("group:test group:rwx\n") diff --git a/spec/unit/puppet/type/acl_spec.rb b/spec/unit/puppet/type/acl_spec.rb index 47d7948..1dadc56 100644 --- a/spec/unit/puppet/type/acl_spec.rb +++ b/spec/unit/puppet/type/acl_spec.rb @@ -9,117 +9,140 @@ end.to raise_error end end + context 'when setting parameters' do it 'works with a correct permission parameter' do resource = acl_type.new name: '/tmp/foo', permission: ['user:root:rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:permission]).to eq(['user:root:rwx']) end + it 'converts a permission string to an array' do resource = acl_type.new name: '/tmp/foo', permission: 'user:root:rwx' expect(resource[:name]).to eq('/tmp/foo') expect(resource[:permission]).to eq(['user:root:rwx']) end + it 'converts the u: shorcut to user:' do resource = acl_type.new name: '/tmp/foo', permission: ['u:root:rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:permission]).to eq(['user:root:rwx']) end + it 'converts the g: shorcut to group:' do resource = acl_type.new name: '/tmp/foo', permission: ['g:root:rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:permission]).to eq(['group:root:rwx']) end + it 'converts the m: shorcut to mask:' do resource = acl_type.new name: '/tmp/foo', permission: ['m::rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:permission]).to eq(['mask::rwx']) end + it 'converts the o: shorcut to other:' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:permission]).to eq(['other::rwx']) end + it 'has the "set" action by default' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:action]).to eq(:set) end + it 'accepts an action "set"' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'], action: :set expect(resource[:name]).to eq('/tmp/foo') expect(resource[:action]).to eq(:set) end + it 'accepts an action "purge"' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'], action: :purge expect(resource[:name]).to eq('/tmp/foo') expect(resource[:action]).to eq(:purge) end + it 'accepts an action "unset"' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'], action: :unset expect(resource[:name]).to eq('/tmp/foo') expect(resource[:action]).to eq(:unset) end + it 'accepts an action "exact"' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'], action: :exact expect(resource[:name]).to eq('/tmp/foo') expect(resource[:action]).to eq(:exact) end + it 'has path as namevar' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:path]).to eq(resource[:name]) end + it 'accepts a path parameter' do resource = acl_type.new path: '/tmp/foo', permission: ['o::rwx'], action: :exact expect(resource[:path]).to eq('/tmp/foo') expect(resource[:name]).to eq(resource[:path]) end + it 'is not recursive by default' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:recursive]).to eq(:false) end + it 'accepts a recursive "true"' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'], recursive: true expect(resource[:name]).to eq('/tmp/foo') expect(resource[:recursive]).to eq(:true) end + it 'accepts a recurse "false"' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'], recursive: false expect(resource[:name]).to eq('/tmp/foo') expect(resource[:recursive]).to eq(:false) end + it 'gets recursemode lazy by default' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'] expect(resource[:name]).to eq('/tmp/foo') expect(resource[:recursemode]).to eq(:lazy) end + it 'accepts a recursemode deep' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'], recursemode: 'deep' expect(resource[:name]).to eq('/tmp/foo') expect(resource[:recursemode]).to eq(:deep) end + it 'accepts a recursemode lazy' do resource = acl_type.new name: '/tmp/foo', permission: ['o::rwx'], recursemode: :lazy expect(resource[:name]).to eq('/tmp/foo') expect(resource[:recursemode]).to eq(:lazy) end + it 'fails with a wrong action' do expect do acl_type.new name: '/tmp/foo', permission: ['o::rwx'], action: :xset end.to raise_error end + it 'fails with a wrong recurselimit' do expect do acl_type.new name: '/tmp/foo', permission: ['o::rwx'], recurselimit: :a end.to raise_error end + it 'fails with a wrong first argument' do expect do acl_type.new name: '/tmp/foo', permission: ['wrong::rwx'] end.to raise_error end + it 'fails with a wrong last argument' do expect do acl_type.new name: '/tmp/foo', permission: ['user::-_-'] @@ -143,12 +166,13 @@ it 'does not do anything with no defaults' do expect(acl_type.pick_default_perms(basic_perms)).to match_array(basic_perms) end + it 'removes defaults' do expect(acl_type.pick_default_perms(advanced_perms)).to match_array(advanced_perms_results) end + it 'removes defaults with d:' do expect(acl_type.pick_default_perms(mysql_perms)).to match_array(mysql_perms_results) end end end -# rubocop:enable RSpec/MultipleExpectations From a252009959434a6eb29400368d112fdfcdad927d Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 09:49:53 +0100 Subject: [PATCH 03/10] rubocop: Fix Style/FrozenStringLiteralComment --- lib/puppet/provider/posix_acl/genericacl.rb | 2 ++ lib/puppet/provider/posix_acl/posixacl.rb | 2 ++ lib/puppet/type/posix_acl.rb | 2 ++ spec/unit/puppet/provider/posixacl_spec.rb | 2 ++ spec/unit/puppet/type/acl_spec.rb | 2 ++ 5 files changed, 10 insertions(+) diff --git a/lib/puppet/provider/posix_acl/genericacl.rb b/lib/puppet/provider/posix_acl/genericacl.rb index 3acf1a5..42ec9ec 100644 --- a/lib/puppet/provider/posix_acl/genericacl.rb +++ b/lib/puppet/provider/posix_acl/genericacl.rb @@ -1,2 +1,4 @@ +# frozen_string_literal: true + Puppet::Type.type(:posix_acl).provide(:genericacl, parent: Puppet::Provider) do end diff --git a/lib/puppet/provider/posix_acl/posixacl.rb b/lib/puppet/provider/posix_acl/posixacl.rb index 375f018..2f4b144 100644 --- a/lib/puppet/provider/posix_acl/posixacl.rb +++ b/lib/puppet/provider/posix_acl/posixacl.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + Puppet::Type.type(:posix_acl).provide(:posixacl, parent: Puppet::Provider) do desc 'Provide posix 1e acl functions using posix getfacl/setfacl commands' diff --git a/lib/puppet/type/posix_acl.rb b/lib/puppet/type/posix_acl.rb index a2b9fb0..7e5833a 100644 --- a/lib/puppet/type/posix_acl.rb +++ b/lib/puppet/type/posix_acl.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'set' require 'pathname' require 'English' diff --git a/spec/unit/puppet/provider/posixacl_spec.rb b/spec/unit/puppet/provider/posixacl_spec.rb index 2914ed0..bb2935f 100644 --- a/spec/unit/puppet/provider/posixacl_spec.rb +++ b/spec/unit/puppet/provider/posixacl_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'rspec/mocks' diff --git a/spec/unit/puppet/type/acl_spec.rb b/spec/unit/puppet/type/acl_spec.rb index 1dadc56..1f209fc 100644 --- a/spec/unit/puppet/type/acl_spec.rb +++ b/spec/unit/puppet/type/acl_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' acl_type = Puppet::Type.type(:posix_acl) From 5dc2fa9c50758d4f6c33d71432796a168e289fea Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 10:04:08 +0100 Subject: [PATCH 04/10] rubocop: disable RSpec/UnspecifiedException --- spec/unit/puppet/type/acl_spec.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spec/unit/puppet/type/acl_spec.rb b/spec/unit/puppet/type/acl_spec.rb index 1f209fc..477487c 100644 --- a/spec/unit/puppet/type/acl_spec.rb +++ b/spec/unit/puppet/type/acl_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' acl_type = Puppet::Type.type(:posix_acl) +# rubocop:disable RSpec/UnspecifiedException describe acl_type do context 'when not setting parameters' do it 'fails without permissions' do @@ -178,3 +179,4 @@ end end end +# rubocop:enable RSpec/UnspecifiedException From d768a546fe54d208cbdcb7998e2f90bb71870888 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 10:05:01 +0100 Subject: [PATCH 05/10] rubocop: disable Naming/MethodParameterName --- lib/puppet/type/posix_acl.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/puppet/type/posix_acl.rb b/lib/puppet/type/posix_acl.rb index 7e5833a..c8ece40 100644 --- a/lib/puppet/type/posix_acl.rb +++ b/lib/puppet/type/posix_acl.rb @@ -3,7 +3,7 @@ require 'set' require 'pathname' require 'English' - +# rubocop:disable Naming/MethodParameterName Puppet::Type.newtype(:posix_acl) do desc <<-EOT Ensures that a set of ACL permissions are applied to a given file @@ -279,3 +279,4 @@ def generate raise(Puppet::Error, 'permission is a required property.') unless self[:permission] end end +# rubocop:enable Naming/MethodParameterName From 11711ef55b5e63ab4603ee36fa12ccc9beb0bc9b Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 10:05:15 +0100 Subject: [PATCH 06/10] rubocop: fix Style/CommentedKeyword --- lib/puppet/provider/posix_acl/posixacl.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/puppet/provider/posix_acl/posixacl.rb b/lib/puppet/provider/posix_acl/posixacl.rb index 2f4b144..2cc9feb 100644 --- a/lib/puppet/provider/posix_acl/posixacl.rb +++ b/lib/puppet/provider/posix_acl/posixacl.rb @@ -88,7 +88,8 @@ def check_set @resource.value(:action) == :set end - def permission=(_value) # TODO: Investigate why we're not using this parameter + # TODO: Investigate why we're not using this parameter + def permission=(_value) Puppet.debug @resource.value(:action) case @resource.value(:action) when :unset From 9edfa4ea5f95d6e2c696ebbc805241a8e930c48e Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 10:06:44 +0100 Subject: [PATCH 07/10] rubocop: disable certain checks --- lib/puppet/provider/posix_acl/genericacl.rb | 2 +- lib/puppet/provider/posix_acl/posixacl.rb | 2 +- lib/puppet/type/posix_acl.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/puppet/provider/posix_acl/genericacl.rb b/lib/puppet/provider/posix_acl/genericacl.rb index 42ec9ec..dd35d3a 100644 --- a/lib/puppet/provider/posix_acl/genericacl.rb +++ b/lib/puppet/provider/posix_acl/genericacl.rb @@ -1,4 +1,4 @@ # frozen_string_literal: true -Puppet::Type.type(:posix_acl).provide(:genericacl, parent: Puppet::Provider) do +Puppet::Type.type(:posix_acl).provide(:genericacl, parent: Puppet::Provider) do # rubocop:disable Lint/EmptyBlock end diff --git a/lib/puppet/provider/posix_acl/posixacl.rb b/lib/puppet/provider/posix_acl/posixacl.rb index 2cc9feb..7c15964 100644 --- a/lib/puppet/provider/posix_acl/posixacl.rb +++ b/lib/puppet/provider/posix_acl/posixacl.rb @@ -108,7 +108,7 @@ def permission=(_value) # Unset perms always should match against lowercased x. perm_to_unset = cur_perm - new_perm perm_to_unset_check = lc_cur_perm - lc_new_perm - return false if perm_to_set_check.empty? && perm_to_unset_check.empty? + return false if perm_to_set_check.empty? && perm_to_unset_check.empty? # rubocop:disable Lint/ReturnInVoidContext # Take supplied perms literally, unset any existing perms which # are absent from ACLs given diff --git a/lib/puppet/type/posix_acl.rb b/lib/puppet/type/posix_acl.rb index c8ece40..4d75166 100644 --- a/lib/puppet/type/posix_acl.rb +++ b/lib/puppet/type/posix_acl.rb @@ -241,7 +241,7 @@ def self.pick_default_perms(acl) end def newchild(path) - options = @original_parameters.merge(name: path).reject { |_param, value| value.nil? } + options = @original_parameters.merge(name: path).reject { |_param, value| value.nil? } # rubocop:disable Style/CollectionCompact options[:permission] = self.class.pick_default_perms(options[:permission]) if !File.directory?(options[:name]) && options.include?(:permission) %i[recursive recursemode path].each do |param| options.delete(param) if options.include?(param) From ac0ab49bb1f7046f357b43fa3a4de10758e530d2 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 10:07:48 +0100 Subject: [PATCH 08/10] fix wrong namespaces --- lib/puppet/type/posix_acl.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/type/posix_acl.rb b/lib/puppet/type/posix_acl.rb index 4d75166..822fa57 100644 --- a/lib/puppet/type/posix_acl.rb +++ b/lib/puppet/type/posix_acl.rb @@ -113,7 +113,7 @@ def self.descendant?(a, b) newproperty(:permission, array_matching: :all) do desc 'ACL permission(s).' - def is_to_s(value) # rubocop:disable Style/PredicateName + def is_to_s(value) # rubocop:disable Naming/PredicateName if value == :absent || value.include?(:absent) super else @@ -162,7 +162,7 @@ def unset_insync(cur_perm) # Make sure we are not misinterpreting recursive permission notation (e.g. rwX) when # comparing current to new perms. - def set_insync(cur_perm) # rubocop:disable Style/AccessorMethodName + def set_insync(cur_perm) # rubocop:disable Naming/AccessorMethodName lc_cur_perm = cur_perm.map(&:downcase).uniq.sort should = @should.map(&:downcase).uniq.sort (lc_cur_perm.sort == should) || (provider.check_set && (should - lc_cur_perm).empty?) From ddf21049ee6275a30c3100f92d164f5f7fe44f78 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 10:10:16 +0100 Subject: [PATCH 09/10] Drop EoL Puppet 5 support --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index ff9f894..0d59d31 100644 --- a/metadata.json +++ b/metadata.json @@ -50,7 +50,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 5.5.8 < 8.0.0" + "version_requirement": ">= 6.1.0 < 8.0.0" } ], "description": "Manages posix 1e ACLs on files, provides base classes so additional ACL standards can be supported.", From 0d66d1eb8704b45955c0e3dcb36c970034dbbe0f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 20 Jan 2022 10:11:22 +0100 Subject: [PATCH 10/10] fix frozen string violation --- lib/puppet/type/posix_acl.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/type/posix_acl.rb b/lib/puppet/type/posix_acl.rb index 822fa57..6c5f6b3 100644 --- a/lib/puppet/type/posix_acl.rb +++ b/lib/puppet/type/posix_acl.rb @@ -199,7 +199,7 @@ def insync?(is) r << 'default:' end t = a.shift # Copy the type. - r << case t + r += case t when 'u', 'user' 'user:' when 'g', 'group'