Skip to content

Commit 8e9ab0c

Browse files
authored
Merge pull request #7975 from tvpartytonight/PUP-10142-refactor-settings-to-55x
(PUP-10142) refactor settings initialization
2 parents 58efa43 + a5ae340 commit 8e9ab0c

File tree

2 files changed

+2061
-2054
lines changed

2 files changed

+2061
-2054
lines changed

lib/puppet.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
require 'puppet/external/pson/version'
2323
require 'puppet/external/pson/pure'
2424
require 'puppet/gettext/config'
25+
require 'puppet/defaults'
2526

2627

2728
#------------------------------------------------------------
@@ -87,6 +88,7 @@ def self.[](param)
8788

8889
# Store a new default value.
8990
def self.define_settings(section, hash)
91+
Puppet.deprecation_warning('The method Puppet.define_settings is deprecated and will be removed in a future release')
9092
@@settings.define_settings(section, hash)
9193
end
9294

@@ -121,8 +123,9 @@ def self.run_mode
121123
Puppet::Util::RunMode[@@settings.preferred_run_mode]
122124
end
123125

124-
# Load all of the settings.
125-
require 'puppet/defaults'
126+
# Modify the settings with defaults defined in `initialize_default_settings` method in puppet/defaults.rb. This can
127+
# be used in the initialization of new Puppet::Settings objects in the puppetserver project.
128+
Puppet.initialize_default_settings!(settings)
126129

127130
# Now that settings are loaded we have the code loaded to be able to issue
128131
# deprecation warnings. Warn if we're on a deprecated ruby version.

0 commit comments

Comments
 (0)