diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-11-13 06:11:39 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-11-13 06:11:39 +0000 |
commit | 1bf97cdf3f9b43ee88bda36d1a05aa3d0011598c (patch) | |
tree | b4d143319682a02eef6a69542e4c838003162126 /lib/puppet/parser | |
parent | 50d28efe13f8ce525b32e16c7c882361a86a9758 (diff) | |
download | puppet-1bf97cdf3f9b43ee88bda36d1a05aa3d0011598c.tar.gz puppet-1bf97cdf3f9b43ee88bda36d1a05aa3d0011598c.tar.xz puppet-1bf97cdf3f9b43ee88bda36d1a05aa3d0011598c.zip |
Fixing #339, and the bigger problem it concealed. Metaparams are now only added to resources that do not explicitly set them.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1869 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r-- | lib/puppet/parser/ast/component.rb | 4 | ||||
-rw-r--r-- | lib/puppet/parser/resource.rb | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/lib/puppet/parser/ast/component.rb b/lib/puppet/parser/ast/component.rb index f67d53b4b..a21a03517 100644 --- a/lib/puppet/parser/ast/component.rb +++ b/lib/puppet/parser/ast/component.rb @@ -21,6 +21,10 @@ class Puppet::Parser::AST # These are retrieved when looking up the superclass attr_accessor :name + def child_of?(klass) + false + end + def evaluate(hash) origscope = hash[:scope] objtype = hash[:type] diff --git a/lib/puppet/parser/resource.rb b/lib/puppet/parser/resource.rb index d27c8b27e..8c1153929 100644 --- a/lib/puppet/parser/resource.rb +++ b/lib/puppet/parser/resource.rb @@ -60,6 +60,7 @@ class Puppet::Parser::Resource # from any parent scope, and there's currently no way to turn that off. def addmetaparams Puppet::Type.eachmetaparam do |name| + next if self[name] if val = scope.lookupvar(name.to_s, false) unless val == :undefined set Param.new(:name => name, :value => val, :source => scope.source) @@ -236,6 +237,9 @@ class Puppet::Parser::Resource # Replace it, keeping all of its info. @params[param.name] = param else + if Puppet[:trace] + puts caller + end fail Puppet::ParseError, "Parameter %s is already set on %s by %s" % [param.name, self.to_s, param.source] end |