From 0dc032831796532db1fcaf3a9b75c16ffffa5896 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 2 Jul 2023 23:40:32 +0200 Subject: [PATCH 1/4] Add Puppet 8 support --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 22e4d311..7a8372f2 100644 --- a/metadata.json +++ b/metadata.json @@ -54,7 +54,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 7.0.0 < 8.0.0" + "version_requirement": ">= 7.0.0 < 9.0.0" } ], "dependencies": [ From a3e8d06789e1e3a81f7e5f97b32c6b9c0b20a7ae Mon Sep 17 00:00:00 2001 From: markuszilch Date: Mon, 8 Apr 2024 23:00:13 +0200 Subject: [PATCH 2/4] remove frozen string literal for cs group crm provider --- lib/puppet/provider/cs_group/crm.rb | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/puppet/provider/cs_group/crm.rb b/lib/puppet/provider/cs_group/crm.rb index fa115700..22484cd6 100644 --- a/lib/puppet/provider/cs_group/crm.rb +++ b/lib/puppet/provider/cs_group/crm.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - begin require 'puppet_x/voxpupuli/corosync/provider/crmsh' rescue LoadError From 9f09a4513938f67a87d64539dc8e6b53cb99c91d Mon Sep 17 00:00:00 2001 From: markuszilch Date: Mon, 8 Apr 2024 23:03:10 +0200 Subject: [PATCH 3/4] regenerate rubocop todo --- .rubocop_todo.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 9a195e25..208124dc 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2024-02-20 13:57:00 UTC using RuboCop version 1.50.2. +# on 2024-04-08 21:01:49 UTC using RuboCop version 1.60.2. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -15,6 +15,7 @@ Lint/DuplicateBranch: - 'spec/spec_helper_corosync.rb' # Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). # Configuration parameters: CheckForMethodsWithNoSideEffects. Lint/Void: Exclude: @@ -51,10 +52,24 @@ RSpec/RepeatedExampleGroupBody: - 'spec/acceptance/corosync_class_spec.rb' # Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). +# This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedMethods, AllowedPatterns. # AllowedMethods: ==, equal?, eql? Style/ClassEqualityComparison: Exclude: - 'lib/puppet/provider/cs_primitive/crm.rb' - 'lib/puppet/provider/cs_primitive/pcs.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Exclude: + - 'lib/puppet/provider/cs_group/crm.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantLineContinuation: + Exclude: + - 'spec/unit/puppet/type/cs_clone_spec.rb' From 50fd452606478449506315f4f49c79a8c5b02275 Mon Sep 17 00:00:00 2001 From: Christoph Maser Date: Sun, 13 Oct 2024 11:57:19 +0200 Subject: [PATCH 4/4] fix: use chomp instead of chop in test there where instances where a required '>' was chopped off --- lib/puppet/provider/cs_clone/pcs.rb | 2 +- spec/acceptance/cs_location_spec.rb | 4 +++- spec/acceptance/cs_order_spec.rb | 4 +++- spec/unit/puppet/provider/cs_clone_pcs_spec.rb | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/puppet/provider/cs_clone/pcs.rb b/lib/puppet/provider/cs_clone/pcs.rb index 814f5d21..81d153d0 100644 --- a/lib/puppet/provider/cs_clone/pcs.rb +++ b/lib/puppet/provider/cs_clone/pcs.rb @@ -28,7 +28,7 @@ def change_clone_id(type, primitive, id, cib) return unless doc.root.attributes['id'] != id doc.root.attributes['id'] = id - cmd = [command(:cibadmin), '--replace', '--xpath', xpath, '--xml-text', doc.to_s.chop] + cmd = [command(:cibadmin), '--replace', '--xpath', xpath, '--xml-text', doc.to_s.chomp] self.class.run_command_in_cib(cmd, cib) end diff --git a/spec/acceptance/cs_location_spec.rb b/spec/acceptance/cs_location_spec.rb index 80f4a7c8..4665e9e5 100755 --- a/spec/acceptance/cs_location_spec.rb +++ b/spec/acceptance/cs_location_spec.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: true +# rubocop:disable Style/FrozenStringLiteralComment require 'spec_helper_acceptance' @@ -243,3 +243,5 @@ class { 'corosync': end end end + +# rubocop:enable Style/FrozenStringLiteralComment diff --git a/spec/acceptance/cs_order_spec.rb b/spec/acceptance/cs_order_spec.rb index a97e1802..0cb8421e 100644 --- a/spec/acceptance/cs_order_spec.rb +++ b/spec/acceptance/cs_order_spec.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: true +# rubocop:disable Style/FrozenStringLiteralComment require 'spec_helper_acceptance' @@ -173,3 +173,5 @@ class { 'corosync': end end end + +# rubocop:enable Style/FrozenStringLiteralComment diff --git a/spec/unit/puppet/provider/cs_clone_pcs_spec.rb b/spec/unit/puppet/provider/cs_clone_pcs_spec.rb index f4782389..290c8f9e 100644 --- a/spec/unit/puppet/provider/cs_clone_pcs_spec.rb +++ b/spec/unit/puppet/provider/cs_clone_pcs_spec.rb @@ -245,7 +245,7 @@ def clone_xml(name) Puppet::Util::Execution.expects(:execute).with(['cibadmin', '--query', '--xpath', xpath], failonfail: true, combine: true).at_least_once.returns( Puppet::Util::Execution::ProcessOutput.new(clone_xml('apache_service-clone'), 0) ) - Puppet::Util::Execution.expects(:execute).with(['cibadmin', '--replace', '--xpath', xpath, '--xml-text', clone_xml('apache_service-newclone').chop], failonfail: true, combine: true).at_least_once.returns( + Puppet::Util::Execution.expects(:execute).with(['cibadmin', '--replace', '--xpath', xpath, '--xml-text', clone_xml('apache_service-newclone').chomp], failonfail: true, combine: true).at_least_once.returns( Puppet::Util::Execution::ProcessOutput.new('', 0) ) instance.change_clone_id('primitive', 'apache_service', 'apache_service-newclone', nil)