summaryrefslogtreecommitdiffstats
path: root/lib/puppet/config.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-01 22:28:27 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-01 22:28:27 +0000
commit179779dc5045259aa28f0a9cd052d2e41cf8aa96 (patch)
treeab27ba4a6235bf5b53c90a5bff6de274811cc551 /lib/puppet/config.rb
parent457492836e092374895122e69fa067299bf112ff (diff)
downloadpuppet-179779dc5045259aa28f0a9cd052d2e41cf8aa96.tar.gz
puppet-179779dc5045259aa28f0a9cd052d2e41cf8aa96.tar.xz
puppet-179779dc5045259aa28f0a9cd052d2e41cf8aa96.zip
Changing the setdefaults input format somewhat. It is always a hash of some kind now.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@962 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/config.rb')
-rw-r--r--lib/puppet/config.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/puppet/config.rb b/lib/puppet/config.rb
index aa9f6f9c7..dd08552a5 100644
--- a/lib/puppet/config.rb
+++ b/lib/puppet/config.rb
@@ -253,7 +253,7 @@ class Config
when String, Integer, Float: # nothing
klass = CElement
else
- raise Puppet::Error, "Invalid value '%s' for %s" % [value, param]
+ raise Puppet::Error, "Invalid value '%s' for %s" % [value, hash[:name]]
end
element = klass.new(hash)
element.parent = self
@@ -345,16 +345,16 @@ class Config
# Set a bunch of defaults in a given section. The sections are actually pretty
# pointless, but they help break things up a bit, anyway.
- def setdefaults(section, *defs)
+ def setdefaults(section, defs)
section = symbolize(section)
- #hash.each { |param, value|
- defs.each { |hash|
+ defs.each { |name, hash|
if hash.is_a? Array
tmp = hash
hash = {}
- [:name, :default, :desc].zip(tmp).each { |p, v| hash[p] = v }
+ [:default, :desc].zip(tmp).each { |p,v| hash[p] = v }
end
- hash[:name] = symbolize(hash[:name])
+ name = symbolize(name)
+ hash[:name] = name
hash[:section] = section
name = hash[:name]
if @config.include?(name)