[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35
test branch
puppet-dev at googlegroups.com
Wed Jul 14 10:33:59 UTC 2010
The following commit has been merged in the upstream branch:
commit 5937af412234354382902b80f9f38c6e328ac0a8
Author: Jesse Wolfe <jes5199 at gmail.com>
Date: Wed May 12 18:35:35 2010 -0700
Feature #2935 Unify the codepaths for setting settings
There are two codepaths for setting settings in the settings object: one
for setting individual settings, and one was setting settings in mass,
like in the system settings file.
This patch unifies some of that logic.
Signed-off-by: Jesse Wolfe <jes5199 at gmail.com>
diff --git a/lib/puppet/util/settings.rb b/lib/puppet/util/settings.rb
index c8f85a0..3a4bf5c 100644
--- a/lib/puppet/util/settings.rb
+++ b/lib/puppet/util/settings.rb
@@ -330,8 +330,12 @@ class Puppet::Util::Settings
unsafe_clear(true)
+ metas = {}
data.each do |area, values|
- @values[area] = values
+ metas[area] = values.delete(:_meta)
+ values.each do |key,value|
+ set_value(key, value, area, :dont_trigger_handles => true, :ignore_bad_settings => true )
+ end
end
# Determine our environment, if we have one.
@@ -360,7 +364,7 @@ class Puppet::Util::Settings
# because multiple sections could set the same value
# and I'm too lazy to only set the metadata once.
searchpath.reverse.each do |source|
- if meta = @values[source][:_meta]
+ if meta = metas[source]
set_metadata(meta)
end
end
@@ -470,16 +474,20 @@ class Puppet::Util::Settings
return @service_user_available = user.exists?
end
- def set_value(param, value, type)
+ def set_value(param, value, type, options = {})
param = param.to_sym
unless setting = @config[param]
- raise ArgumentError,
- "Attempt to assign a value to unknown configuration parameter %s" % param.inspect
+ if options[:ignore_bad_settings]
+ return
+ else
+ raise ArgumentError,
+ "Attempt to assign a value to unknown configuration parameter %s" % param.inspect
+ end
end
if setting.respond_to?(:munge)
value = setting.munge(value)
end
- if setting.respond_to?(:handle)
+ if setting.respond_to?(:handle) and not options[:dont_trigger_handles]
setting.handle(value)
end
if ReadOnly.include? param
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list