From 5414aeb59c7c10b34f4a7b617f19d632f1f127d0 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 30 May 2026 23:39:06 +0000 Subject: [PATCH 1/3] Update dependency rubocop to '~> 1.87.0' --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d51baab..28ae3f7 100644 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem_sources.each { |gem_source| source gem_source } group :syntax do gem 'metadata-json-lint' gem 'puppet-lint-trailing_comma-check', require: false - gem 'rubocop', '~> 1.84.0' + gem 'rubocop', '~> 1.87.0' gem 'rubocop-performance', '~> 1.26.0' gem 'rubocop-rake', '~> 0.7.1' gem 'rubocop-rspec', '~> 3.7.0' From 2e34ccd7d738f71754ee09a2f1023c4b60e5b82b Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Sat, 6 Jun 2026 21:14:55 +0000 Subject: [PATCH 2/3] Fix rubocop 1.87 Style/FileOpen and Style/OneClassPerFile offenses - Convert File.open(...).each to File.foreach in gen-ldap-update. - Use block form for File.open in openldap_to_389ds.rb to avoid leaking the file descriptor. - Add a targeted rubocop:disable for Style/OneClassPerFile on Simp::YamlNodeClassifier; the compact namespace form requires a module pre-declaration, so the two top-level definitions are unavoidable without restructuring the public API. Co-Authored-By: Claude Opus 4.7 (1M context) --- scripts/bin/set_environment | 2 +- scripts/sbin/gen-ldap-update | 6 +++--- .../openldap_to_389ds/openldap_to_389ds.rb | 5 +---- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/bin/set_environment b/scripts/bin/set_environment index b132580..38bce74 100755 --- a/scripts/bin/set_environment +++ b/scripts/bin/set_environment @@ -86,7 +86,7 @@ require 'yaml' module Simp; end # Simp::YamlNodeClassifier class -class Simp::YamlNodeClassifier +class Simp::YamlNodeClassifier # rubocop:disable Style/OneClassPerFile DEFAULT_CONFIG_FILE = '/etc/puppetlabs/puppet/environments.yaml'.freeze DEFAULT_ENVIRONMENT = 'production'.freeze diff --git a/scripts/sbin/gen-ldap-update b/scripts/sbin/gen-ldap-update index c0bc300..927461f 100755 --- a/scripts/sbin/gen-ldap-update +++ b/scripts/sbin/gen-ldap-update @@ -17,13 +17,13 @@ end # Try /etc/openldap/ldap.conf first. base_dn = nil if File.readable?('/etc/openldap/ldap.conf') - File.open('/etc/openldap/ldap.conf', 'r').each do |ln| + File.foreach('/etc/openldap/ldap.conf') do |ln| if ln =~ %r{^\s*BASE\s+(.*)$} base_dn = Regexp.last_match(1).strip end end elsif File.readable?('/etc/ldap.conf') - File.open('/etc/ldap.conf').each do |ln| + File.foreach('/etc/ldap.conf') do |ln| if ln =~ %r{^\s*base\s+(.*)$} base_dn = Regexp.last_match(1).strip end @@ -55,7 +55,7 @@ update_dn = [ new_entries = {} current_dn = nil -File.open(default_ldif, 'r').each do |ln| +File.foreach(default_ldif) do |ln| if %r{^\s*$}.match?(ln) current_dn = nil end diff --git a/share/transition_scripts/openldap_to_389ds/openldap_to_389ds.rb b/share/transition_scripts/openldap_to_389ds/openldap_to_389ds.rb index 3679775..c3a9310 100755 --- a/share/transition_scripts/openldap_to_389ds/openldap_to_389ds.rb +++ b/share/transition_scripts/openldap_to_389ds/openldap_to_389ds.rb @@ -156,14 +156,11 @@ def convert_user(attrs) end # Read in the slapcat file -fh = File.open(input_ldif, 'r') begin - ldifs = Net::LDAP::Dataset.read_ldif(fh) + ldifs = File.open(input_ldif, 'r') { |fh| Net::LDAP::Dataset.read_ldif(fh) } rescue StandardError => e warn "ERROR: Malformed LDIF input:\n#{e}\n#{e.backtrace.join("\n")}" exit 1 -ensure - fh.close end basedn ||= ldifs.select { |_k, v| v[:structuralobjectclass].include?('domain') }.keys.first From 225b57252258d1c7486c60ad5773260354e13377 Mon Sep 17 00:00:00 2001 From: Steven Pritchard Date: Sun, 7 Jun 2026 09:20:57 -0500 Subject: [PATCH 3/3] Bump version --- build/simp-utils.spec | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build/simp-utils.spec b/build/simp-utils.spec index ec80041..292dd78 100644 --- a/build/simp-utils.spec +++ b/build/simp-utils.spec @@ -43,7 +43,7 @@ end Summary: SIMP Utils Name: simp-utils -Version: 6.8.1 +Version: 6.8.2 Release: %{lua: print(package_release)}%{?dist} License: Apache License, Version 2.0 Group: Applications/System @@ -113,6 +113,9 @@ chmod -R u=rwx,g=rx,o=rx %{buildroot}/usr/local/*bin # Post uninstall stuff %changelog +* Sun Jun 07 2026 Steven Pritchard - 6.8.2-1 +- Additional cleanup for rubocop + * Wed Sep 17 2025 Steven Pritchard - 6.8.1-1 - Cleanup for rubocop