From b40797b3735b4689664ed7503d94424d4374e099 Mon Sep 17 00:00:00 2001 From: Clement Le Roux Date: Tue, 6 Jun 2023 16:50:56 +0200 Subject: [PATCH] (MODULES-11424) Fix requirement method --- lib/puppet/provider/registry_key/registry.rb | 12 ++---------- lib/puppet/provider/registry_value/registry.rb | 8 +------- lib/puppet/type/registry_key.rb | 7 +------ lib/puppet/type/registry_value.rb | 7 +------ 4 files changed, 5 insertions(+), 29 deletions(-) diff --git a/lib/puppet/provider/registry_key/registry.rb b/lib/puppet/provider/registry_key/registry.rb index 1b81f15..908de18 100644 --- a/lib/puppet/provider/registry_key/registry.rb +++ b/lib/puppet/provider/registry_key/registry.rb @@ -1,15 +1,7 @@ # frozen_string_literal: true -# REMIND: need to support recursive delete of subkeys & values -begin - # We expect this to work once Puppet supports Rubygems in #7788 - require 'puppet_x/puppetlabs/registry' -rescue LoadError - # Work around #7788 (Rubygems support for modules) - require 'pathname' # JJM WORK_AROUND #14073 - module_base = Pathname.new(__FILE__).dirname - require "#{module_base}../../../puppet_x/puppetlabs/registry" -end +require_relative '../../../puppet_x/puppetlabs/registry' + # rubocop:disable Metrics/BlockLength Puppet::Type.type(:registry_key).provide(:registry) do desc <<-DOC diff --git a/lib/puppet/provider/registry_value/registry.rb b/lib/puppet/provider/registry_value/registry.rb index 096afbd..59107b8 100644 --- a/lib/puppet/provider/registry_value/registry.rb +++ b/lib/puppet/provider/registry_value/registry.rb @@ -1,13 +1,7 @@ # frozen_string_literal: true require 'puppet/type' -begin - require 'puppet_x/puppetlabs/registry' -rescue LoadError - require 'pathname' # JJM WORK_AROUND #14073 and #7788 - module_base = "#{Pathname.new(__FILE__).dirname}../../../" - require "#{module_base}puppet_x/puppetlabs/registry" -end +require_relative '../../../puppet_x/puppetlabs/registry' # rubocop:disable Metrics/BlockLength Puppet::Type.type(:registry_value).provide(:registry) do diff --git a/lib/puppet/type/registry_key.rb b/lib/puppet/type/registry_key.rb index 3110a98..278a5f2 100644 --- a/lib/puppet/type/registry_key.rb +++ b/lib/puppet/type/registry_key.rb @@ -1,12 +1,7 @@ # frozen_string_literal: true require 'puppet/type' -begin - require 'puppet_x/puppetlabs/registry' -rescue LoadError - require 'pathname' # JJM WORK_AROUND #14073 and #7788 - require "#{Pathname.new(__FILE__).dirname}../../puppet_x/puppetlabs/registry" -end +require_relative '../../puppet_x/puppetlabs/registry' # @summary # Manages registry keys on Windows systems diff --git a/lib/puppet/type/registry_value.rb b/lib/puppet/type/registry_value.rb index 32f495b..9414bea 100644 --- a/lib/puppet/type/registry_value.rb +++ b/lib/puppet/type/registry_value.rb @@ -1,12 +1,7 @@ # frozen_string_literal: true require 'puppet/type' -begin - require 'puppet_x/puppetlabs/registry' -rescue LoadError - require 'pathname' # JJM WORK_AROUND #14073 and #7788 - require "#{Pathname.new(__FILE__).dirname}../../puppet_x/puppetlabs/registry" -end +require_relative '../../puppet_x/puppetlabs/registry' # @summary # Manages registry values on Windows systems.