summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-19 16:30:20 -0600
committerLuke Kanies <luke@madstop.com>2007-11-19 16:30:20 -0600
commit1bf3999ec08f41e35036b303914987e2c0174922 (patch)
tree9e9da2028b357fddb23dcd07f46d7dcf89ad1dd1 /lib/puppet/parser
parent3f0b250f6694525fbcc40414cf0778186696b2ee (diff)
downloadpuppet-1bf3999ec08f41e35036b303914987e2c0174922.tar.gz
puppet-1bf3999ec08f41e35036b303914987e2c0174922.tar.xz
puppet-1bf3999ec08f41e35036b303914987e2c0174922.zip
Fixing a failing test from my fix for #446 -- I had changed
the behaviour of Resource#override_parameter unintentionally. I've corrected the comments so it's clear why the original behaviour was there.
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/resource.rb11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index ea0f93f57..2f7fff13f 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -403,12 +403,11 @@ class Puppet::Parser::Resource
# If we've gotten this far, we're allowed to override.
# Merge with previous value, if the parameter was generated with the +> syntax.
- if param.add
- current.value = [current.value, param.value].flatten
- else
- # Just replace the existing parameter with this new one.
- @params[param.name] = param
- end
+ # It's important that we use the new param instance here, not the old one,
+ # so that the source is registered correctly for later overrides.
+ param.value = [current.value, param.value].flatten if param.add
+
+ @params[param.name] = param
end
# Verify that all passed parameters are valid. This throws an error if