Issue #18041 has been updated by Josh Cooper.

Status changed from Accepted to In Topic Branch Pending Review
Target version changed from 3.0.2 to 3.1.0
Branch set to https://github.com/puppetlabs/puppet/pull/1322


----------------------------------------
Bug #18041: Puppet::Util::Autoload.list_loaded is broken
https://projects.puppetlabs.com/issues/18041#change-78483

Author: Josh Cooper
Status: In Topic Branch Pending Review
Priority: Normal
Assignee: 
Category: 
Target version: 3.1.0
Affected Puppet version: 0.24.0
Keywords: autoload
Branch: https://github.com/puppetlabs/puppet/pull/1322


The `list_loaded` method does:

<pre>
      loaded.keys.sort { |a,b| a[0] <=> b[0] }.collect do |path, hash|
        "#{path}: #{hash[:file]}"
      end
</pre>

The method was added in `7befe1bc`, but was broken in `6700adcacd`, because the 
code that adds autoloaded files to the hash uses a different hashkey. Calling 
this method results in:

<pre>
1.8.7 :011 > loader.class.list_loaded
NoMethodError: undefined method `[]' for nil:NilClass
        from /Users/josh/work/puppet/lib/puppet/util/autoload.rb:25:in 
`list_loaded'
        from /Users/josh/work/puppet/lib/puppet/util/autoload.rb:24:in `collect'
        from /Users/josh/work/puppet/lib/puppet/util/autoload.rb:24:in 
`list_loaded'
        from (irb):11
</pre>

Since this method blows up if called, it is safe to remove.


-- 
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 puppet-bugs@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-bugs+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to