diff options
author | Michael Stahnke <stahnma@puppetlabs.com> | 2011-08-05 09:23:49 -0700 |
---|---|---|
committer | Michael Stahnke <stahnma@puppetlabs.com> | 2011-08-05 09:23:49 -0700 |
commit | 3daea902b29cfd8e126ed64247ddf28aa5ad3d76 (patch) | |
tree | cda7fff4d06c7f3607a84b260fd71adfd9704e3b /lib/puppet/parser/functions/create_resources.rb | |
parent | c8835ad0275c350b57884b81e485d9fc16699a21 (diff) | |
parent | 2185bb2804aeef6b419667951b2157b01404c694 (diff) | |
download | puppet-3daea902b29cfd8e126ed64247ddf28aa5ad3d76.tar.gz puppet-3daea902b29cfd8e126ed64247ddf28aa5ad3d76.tar.xz puppet-3daea902b29cfd8e126ed64247ddf28aa5ad3d76.zip |
Merge branch '2.7.x' into 2.7rc
Diffstat (limited to 'lib/puppet/parser/functions/create_resources.rb')
-rw-r--r-- | lib/puppet/parser/functions/create_resources.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/puppet/parser/functions/create_resources.rb b/lib/puppet/parser/functions/create_resources.rb index 430f110b4..3b8bb3543 100644 --- a/lib/puppet/parser/functions/create_resources.rb +++ b/lib/puppet/parser/functions/create_resources.rb @@ -27,15 +27,16 @@ Takes two parameters: args[1].each do |title, params| raise ArgumentError, 'params should not contain title' if(params['title']) case type_of_resource - when :type - res = resource.hash2resource(params.merge(:title => title)) - catalog.add_resource(res) - when :define + # JJM The only difference between a type and a define is the call to instantiate_resource + # for a defined type. + when :type, :define p_resource = Puppet::Parser::Resource.new(type_name, title, :scope => self, :source => resource) params.merge(:name => title).each do |k,v| p_resource.set_parameter(k,v) end - resource.instantiate_resource(self, p_resource) + if type_of_resource == :define then + resource.instantiate_resource(self, p_resource) + end compiler.add_resource(self, p_resource) when :class klass = find_hostclass(title) |