Issue #12668 has been updated by david boldt.

  class snmp::solaris inherits snmp {
    $source = $architecture ? {
      sun4u   => 
'/afs/usgs.gov/apps/src/Packages/netsnmp-5.7-sol10-sparc-local',
      i386    => 
'/afs/usgs.gov/apps/src/Packages/netsnmp-5.4.2.1-sol10-x86-local',
      default => undef,
    }
    if(!$source) {
      # http://projects.puppetlabs.com/issues/4598
      fail("no snmp package path for arch ${architecture} on ${fqdn}")
    }
    # point to the location of package
    package { $snmp:
      ensure   => installed,
      source   => $source,
      #require => Package['openssl'],
      provider => 'sun',
    }

When I try to execute it I get an error that looks like this:

err: /Stage[main]/Snmp::Snmp::Solaris/Package[SFWnetsnmp]: Could not evaluate: 
Unable to get information about package SFWnetsnmp because of: ["ERROR: 
information for \"SFWnetsnmp\" was not found\n"]

Which looks an awful lot like the output of this:

% pkginfo SFWnetsnmp                           
ERROR: information for "SFWnetsnmp" was not found

----------------------------------------
Bug #12668: package issue for provider sun
https://projects.puppetlabs.com/issues/12668#change-54935

Author: Ken Dreyer
Status: Needs More Information
Priority: Normal
Assignee: 
Category: package
Target version: 
Affected Puppet version: 2.7.10
Keywords: 
Branch: 


>From the mailinglist: 
>https://groups.google.com/group/puppet-users/browse_thread/thread/d8fcf44a79258e62

The sun package provider uses a regex to determine whether a package is 
installed or not. This regex appears to be broken when a package does not yet 
exist. Can someone with Ruby experience please tell us what the proper regex 
should be here? Is Regexp.escape() doing the wrong thing?

This does not work:
-      return {:ensure => :absent} if detail.message =~ /information for 
"#{Regexp.escape(@resource[:name])}" was not found/

This works:
+      return {:ensure => :absent} if detail.message =~ /information for .* was 
not found/


-- 
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