summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/resource.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-04-01 07:22:31 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-04-22 03:26:10 +1000
commite6b420088978adb3b3dd930db033df6dce59f124 (patch)
treeac3b43c0594608d016e8034011816c10dafce46d /lib/puppet/parser/resource.rb
parent50e0f3d0161bc4160e36a93d15fba53302b8727b (diff)
downloadpuppet-e6b420088978adb3b3dd930db033df6dce59f124.tar.gz
puppet-e6b420088978adb3b3dd930db033df6dce59f124.tar.xz
puppet-e6b420088978adb3b3dd930db033df6dce59f124.zip
Fixing #1885 - Relationships metaparams do not cascade
Because we now pass catalogs around, rather than a tree of resources, we no longer lose the metaparam information in definitions and classes. Thus, we no longer need to pass them down to contained resources. Ideally we'd remove cascading of all metaparams (which is ticket #1903) but 'schedule' and 'noop' are inherently recursive but not in a way that the graph support can currently easily solve, so that's going to have to wait for a later release. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/parser/resource.rb')
-rw-r--r--lib/puppet/parser/resource.rb8
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb
index e016a3047..8d29ea346 100644
--- a/lib/puppet/parser/resource.rb
+++ b/lib/puppet/parser/resource.rb
@@ -357,20 +357,16 @@ class Puppet::Parser::Resource
# from any parent scope, and there's currently no way to turn that off.
def add_metaparams
Puppet::Type.eachmetaparam do |name|
+ next if self.class.relationship_parameter?(name)
# Skip metaparams that we already have defined, unless they're relationship metaparams.
# LAK:NOTE Relationship metaparams get treated specially -- we stack them, instead of
# overriding.
- next if @params[name] and not self.class.relationship_parameter?(name)
- next if @params[name] and @params[name].value == :undef
+ next if @params[name]
# Skip metaparams for which we get no value.
next unless val = scope.lookupvar(name.to_s, false) and val != :undefined
- # The default case: just set the value
set_parameter(name, val) and next unless @params[name]
-
- # For relationship params, though, join the values (a la #446).
- @params[name].value = [@params[name].value, val].flatten
end
end