Bug #12668
package issue for provider sun
| Status: | Closed | Start date: | 02/15/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | % Done: | 0% | ||
| Category: | package | |||
| Target version: | 3.0.0 | |||
| Affected Puppet version: | 2.7.10 | Branch: | ||
| Keywords: | ||||
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
History
#1
Updated by Daniel Pittman over 1 year 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 1 year 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 1 year 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 11 months ago
- Assignee set to Rahul Gopinath
#5
Updated by Rahul Gopinath 11 months 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 10 months ago
- Status changed from In Topic Branch Pending Review to Merged - Pending Release
- Target version set to 3.x
#7
Updated by Josh Cooper 10 months ago
- Target version changed from 3.x to 3.0.0
#8
Updated by Moses Mendoza 9 months ago
- Status changed from Merged - Pending Release to Closed
released in 3.0.0-rc4