Issue #8050 has been updated by Jeff McCune.

Status changed from Needs More Information to Duplicate

Duplicate of #7422
----------------------------------------
Bug #8050: For Jeff: Shave this yak undefined method `<<' for {}:Hash on node 
keenan.local
https://projects.puppetlabs.com/issues/8050

Author: Jeff McCune
Status: Duplicate
Priority: Normal
Assignee: Jeff McCune
Category: 
Target version: 
Affected Puppet version: 2.6.4
Keywords: metaprogramming poor_error_message


Branch: 


This is related to something like this:

<pre>
 58   if $manage_users_real {
 59     # This section of the code is repsonsible for pulling in the data we 
need.
 60     $users_hash = getvar("${data_namespace_real}::users_hash")
 61 
 62     class { 'accounts::users':
 63       users_hash => $users_hash,
 64       require     => Anchor['accounts::begin'],
 65       before      => Anchor['accounts::end'],
 66     }
 67 
 68     if $manage_groups_real {
 69       Class['accounts::groups'] -> Class['accounts::users']
 70     }
 71 
 72   }
</pre>

Working on the accounts module.

Dan believes this has something to do with using the new arrow relationship 
syntax in combination with metaparameters.


Additional Information:

<pre>
undefined method `<<' for {}:Hash on node centos56-64.vagrant.internal
       /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:148:in
`exit'
       /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:148:in
`main'
       /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application/apply.rb:35:in
`run_command'
       /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'
       /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:393:in
`exit_on_fail'
       /opt/puppet/lib/ruby/site_ruby/1.8/puppet/application.rb:287:in `run'
       /opt/puppet/lib/ruby/site_ruby/1.8/puppet/util/command_line.rb:55:in
`execute'
       /opt/puppet/bin/puppet:4
       /opt/puppet/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/bin/rdebug:126:in
`debug_load'
       /opt/puppet/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/bin/rdebug:126:in
`debug_program'
       /opt/puppet/lib/ruby/gems/1.8/gems/ruby-debug-0.10.4/bin/rdebug:413
       /opt/puppet/bin/rdebug:19:in `load'
       /opt/puppet/bin/rdebug:19
Uncaught exception: exit

[root@centos56-64 ~]# rdebug -- puppet apply -v --debug --trace
--graph --graphdir /vagrant/tmp/centos56-64 --modulepath
/vagrant/modules /vagrant/modules/accounts/tests/init.pp
/opt/puppet/bin/puppet:3
require 'puppet/util/command_line'
(rdb:1) b /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:41
Breakpoint 1 file
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb, line
41
(rdb:1) c
debug: importing '/vagrant/modules/accounts/manifests/init.pp' in
environment production
debug: Automatically imported accounts from accounts into production
debug: importing '/vagrant/modules/accounts/manifests/data.pp' in
environment production
debug: Automatically imported accounts::data from accounts/data into production
debug: importing '/vagrant/modules/accounts/manifests/groups.pp' in
environment production
debug: Automatically imported accounts::groups from accounts/groups
into production
debug: importing '/vagrant/modules/accounts/manifests/users.pp' in
environment production
debug: Automatically imported accounts::users from accounts/users into
production
debug: Adding relationship from Class[Accounts::Groups] to
Class[Accounts::Users] with 'before'
Breakpoint 1 at
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:41
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb:41
source_resource[param_name] << target.to_s
(rdb:1) l
[36, 43] in /opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/relationship.rb
  36      unless target_resource = catalog.resource(target.to_s)
  37        raise ArgumentError, "Could not find resource '#{target}'
for relationship from '#{source}'"
  38      end
  39      Puppet.debug "Adding relationship from #{source.to_s} to
#{target.to_s} with '#{param_name}'"
  40      source_resource[param_name] ||= []
=> 41      source_resource[param_name] << target.to_s
  42    end
  43  end
(rdb:1) e param_name
:before
(rdb:1) e source_resource[param_name]
#<Puppet::Resource:0x2b26df4e67a0 @parameters={},
@title="accounts::end", @tags=["anchor", "accounts::end", "accounts",
"end"], @reference=#<Puppet::Resource::Reference:0x2b26df4e6200
@title="accounts::end", @type="Anchor">, @type="Anchor">
(rdb:1) e source_resource[param_name].respond_to?('<<')
true
(rdb:1) n
/opt/puppet/lib/ruby/site_ruby/1.8/puppet/parser/compiler.rb:20
puts detail.backtrace if Puppet[:trace]
(rdb:1)
</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.

Reply via email to