Issue #2940 has been updated by Alan Harder.

I looked at hash2info in provider/package/sun.rb, and tried changing "return 
nil" to "return {}" in the rescue block for Puppet::ExecutionFailure.  This 
avoided the nil:NilClass error, and instead I got:
<pre>
debug: //Node[<nodename>]/Package[<pkgname>]/ensure: <pkgname> 
"<currentversion>" is installed, latest is nil
</pre>

It then preceded to pkgrm the package.. so this behavior isn't great either.  
Would be better to report the error in determining the version of the given 
package source, and abort before doing pkgrm of the existing package.

----------------------------------------
Bug #2940: Package resource with ensure=>latest and invalid source gives 
"undefined method" error msg
http://projects.reductivelabs.com/issues/2940

Author: Alan Harder
Status: Needs more information
Priority: Normal
Assigned to: Alan Harder
Category: package
Target version: 0.25.2
Affected version: 0.25.2rc1
Keywords: 
Branch: 


<pre>
package {
  source => '/bogus/path',
  ensure => 'latest',
  provider => 'sun'
}
</pre>

with something like this the error message I see with current 0.25.x branch 
from git looks like this:
@Failed to retrieve current state of resource: Could not get latest version: 
undefined method `[]' for nil:NilClass@

Getting an error is correct, as the source is an invalid path, but the 
"undefined method" in "nil:NilClass" looks odd.



-- 
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://reductivelabs.com/redmine/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