Issue #5220 has been updated by Matt Robinson.
Assignee changed from Dan Bode to Matt Robinson
I just ran into this while testing too and would like to resolve it because
it's a pain to track down, but am not sure of the correct behavior.
You can also get around this error by declaring a name parameter for your type.
Puppet.newtype('blond') do
newparam(:name)
end
Should types be required to declare a namevar or at least the parameter name?
If so, then we should probably raise an error when the type is declared. This
seems likely to me. My understanding of namevar is that it's like a primary
key for resources, so we should almost certainly have one.
If not then, something probably needs to be fixed in the area of
lib/puppet/resource.rb in the parse_title method or in lib/puppet/type.rb
title_patterns method so that a hash is returned instead of an array.
----------------------------------------
Bug #5220: when namevar is not specified for a type, error message is
'undefined method `merge' for []:Array'
https://projects.puppetlabs.com/issues/5220
Author: Dan Bode
Status: Investigating
Priority: Normal
Assignee: Matt Robinson
Category: RAL
Target version:
Affected Puppet version:
Keywords:
Branch:
a more useful message would be helpful.
stack trace:
<pre>
root@puppet:/etc/puppet/modules# puppet apply --trace --debug
tests/openfire.pp
/usr/lib/ruby/1.8/puppet/resource.rb:206:in `to_hash'
/usr/lib/ruby/1.8/puppet/type.rb:1730:in `initialize'
/usr/lib/ruby/1.8/puppet/resource.rb:246:in `new'
/usr/lib/ruby/1.8/puppet/resource.rb:246:in `to_ral'
/usr/lib/ruby/1.8/puppet/resource/catalog.rb:553:in `send'
/usr/lib/ruby/1.8/puppet/resource/catalog.rb:553:in `to_catalog'
/usr/lib/ruby/1.8/puppet/resource/catalog.rb:531:in `each'
/usr/lib/ruby/1.8/puppet/resource/catalog.rb:531:in `to_catalog'
/usr/lib/ruby/1.8/puppet/resource/catalog.rb:468:in `to_ral'
/usr/lib/ruby/1.8/puppet/application/apply.rb:118:in `main'
/usr/lib/ruby/1.8/puppet/application/apply.rb:35:in `run_command'
/usr/lib/ruby/1.8/puppet/application.rb:300:in `run'
/usr/lib/ruby/1.8/puppet/application.rb:397:in `exit_on_fail'
/usr/lib/ruby/1.8/puppet/application.rb:300:in `run'
/usr/lib/ruby/1.8/puppet/util/command_line.rb:55:in `execute'
/usr/bin/puppet:4
undefined method `merge' for []:Array
</pre>
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.