The Puppet Labs Issue Tracker has Moved: https://tickets.puppetlabs.com

Bug #12668

package issue for provider sun

Added by Ken Dreyer over 2 years ago. Updated almost 2 years ago.

Status:ClosedStart date:02/15/2012
Priority:NormalDue date:
Assignee:Rahul Gopinath% Done:

0%

Category:package
Target version:3.0.0
Affected Puppet version:2.7.10 Branch:
Keywords:

We've Moved!

Ticket tracking is now hosted in JIRA: https://tickets.puppetlabs.com

This issue is currently not available for export. If you are experiencing the issue described below, please file a new ticket in JIRA. Once a new ticket has been created, please add a link to it that points back to this Redmine ticket.


Description

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/


Related issues

Duplicated by Puppet - Bug #15343: Solaris package installation failed - Could not evaluate:... Duplicate 07/03/2012

History

#1 Updated by Anonymous over 2 years ago

  • Category set to package
  • Status changed from Unreviewed to Needs More Information

Ken Dreyer wrote:

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/

Thanks for the report. Part of my challenge is that I would have thought the current code was correct, and I can’t spot why it wouldn’t do the right thing. The Regexp.escape should absolutely make it match the literal string of the resource.

Can you supply some additional details to help understand this:

  • the package stanza from your manifest
  • the output of the pkginfo -l ${name} command

#2 Updated by david boldt over 2 years ago

  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

#3 Updated by Ken Dreyer over 2 years ago

If it wasn’t clear, David Boldt is my co-worker and we are both seeing this on Solaris.

#4 Updated by Rahul Gopinath about 2 years ago

  • Assignee set to Rahul Gopinath

#5 Updated by Rahul Gopinath almost 2 years ago

  • Status changed from Needs More Information to In Topic Branch Pending Review

The pull request is here. Specifically the problem was that the execpipe was returning an array rather than a string because it depended on the caller block returning a valid value. The use of execpipe has now been replaced by execute which does not use a callback block.

#6 Updated by Rahul Gopinath almost 2 years ago

  • Status changed from In Topic Branch Pending Review to Merged - Pending Release
  • Target version set to 3.x

#7 Updated by Josh Cooper almost 2 years ago

  • Target version changed from 3.x to 3.0.0

#8 Updated by Moses Mendoza almost 2 years ago

  • Status changed from Merged - Pending Release to Closed

released in 3.0.0-rc4

Also available in: Atom PDF