diff options
author | Paul Berry <paul@puppetlabs.com> | 2010-10-08 15:26:28 -0700 |
---|---|---|
committer | Markus Roberts <Markus@reality.com> | 2010-10-27 14:25:38 -0700 |
commit | 65ef24e5c1c33b7d42012891d368917fd6aaf68c (patch) | |
tree | 6ce4f48fafdb10a59a0626fe8afb54e39f135c73 /lib/puppet/parser/compiler.rb | |
parent | 3b53bfcd0dd20a43c751b2b0d5dbb0e3463ef47b (diff) | |
download | puppet-65ef24e5c1c33b7d42012891d368917fd6aaf68c.tar.gz puppet-65ef24e5c1c33b7d42012891d368917fd6aaf68c.tar.xz puppet-65ef24e5c1c33b7d42012891d368917fd6aaf68c.zip |
(#4534/#4778) -- Normalize parameterized classes
This is a reconciliation/melding of Paul's
(#4534) Class inheritance with parameterized classes is no longer ignored
and Markus's
Fix for #4778 -- evaluate parameterized classes when they are instantiated
Extracted the code from Resource::Type#mk_plain_resource that evaluates
parents and tags the catalog, and moved that into a new method called
instantiate_resource. Instantiate_resource is now also called from
Parser::Ast::Resource#evaluate, so that the notation
"class { classname: }"
now executes this code too. Likewise adds class evaluation so that it behaves
the same (with regard to lazy / strict evaluation) as
include classname
Diffstat (limited to 'lib/puppet/parser/compiler.rb')
-rw-r--r-- | lib/puppet/parser/compiler.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index e1227e753..c60e1d4fb 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -144,7 +144,7 @@ class Puppet::Parser::Compiler if klass = scope.find_hostclass(name) found << name and next if scope.class_scope(klass) - resource = klass.mk_plain_resource(scope) + resource = klass.ensure_in_catalog(scope) # If they've disabled lazy evaluation (which the :include function does), # then evaluate our resource immediately. @@ -220,7 +220,7 @@ class Puppet::Parser::Compiler # Create a resource to model this node, and then add it to the list # of resources. - resource = astnode.mk_plain_resource(topscope) + resource = astnode.ensure_in_catalog(topscope) resource.evaluate |