Issue #12668 has been updated by Daniel Pittman. 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 ---------------------------------------- Bug #12668: package issue for provider sun https://projects.puppetlabs.com/issues/12668#change-54916 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.
