Issue #2999 has been updated by Markus Roberts.
Status changed from Accepted to Needs design decision
So the best answer is probably to go for compatibility with other providers.
What do they do?
* *bsd
propogate error or return nil
* appdmg, apple, pkgdmg no tool call (direct file system check), so not
directly analogous
return nil
* blastwave:
Puppet.warning "Cannot match %s" % line
return {:ensure => :absent}
* darwin port:
raise Puppet::DevError,"Failed to match dpkg line %s" % line
* dpkg:
return {:ensure => :purged, :status => 'missing', :name =>
@resource[:name], :error => 'ok'}
* gem
Puppet.warning "Could not match %s" % desc
return nil
* hpux
return {:ensure => :absent}
* portage:
raise Puppet::Error.new("No package found with the specified name
[#{not_found_value}]")
* ports, rpm, rug, up2date, urpmi, yum
return nil
So it looks like the most popular answer is to return nil (which could manifest
an analog of #2940); the second most popular is raising/propagating an error
(which is what it does now). I think my favorite would be {:ensure => :absent}
but I'm unclear why this isn't being done more often.
----------------------------------------
Bug #2999: Absent package problem on Solaris
http://projects.reductivelabs.com/issues/2999
Author: Mark Plaksin
Status: Needs design decision
Priority: Normal
Assigned to: Markus Roberts
Category: package
Target version: 0.25.2
Affected version: 0.25.2rc3
Keywords:
Branch:
On Solaris 9 and 10 this puppet code causes an error when puppetd runs:
package { TSSalert-sysadmin:
ensure => absent,
}
The package is *not* installed and the backtrace I get is:
/home/happy/puppet.git/lib/puppet/util.rb:214:in `execpipe'
/home/happy/puppet.git/lib/puppet/provider/package/sun.rb:94:in `info2hash'
/home/happy/puppet.git/lib/puppet/provider/package/sun.rb:147:in `query'
/home/happy/puppet.git/lib/puppet/provider/package.rb:22:in `properties'
/home/happy/puppet.git/lib/puppet/type/package.rb:310:in `retrieve'
/home/happy/puppet.git/lib/puppet/type.rb:726:in `evaluate'
/home/happy/puppet.git/lib/puppet/transaction.rb:62:in `apply'
/home/happy/puppet.git/lib/puppet/transaction.rb:251:in
`eval_children_and_apply_resource'
/home/happy/puppet.git/lib/puppet/util.rb:400:in `thinmark'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:293:in `measure'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:307:in `realtime'
/home/happy/puppet.git/lib/puppet/util.rb:399:in `thinmark'
/home/happy/puppet.git/lib/puppet/transaction.rb:250:in
`eval_children_and_apply_resource'
/home/happy/puppet.git/lib/puppet/transaction.rb:207:in `eval_resource'
/home/happy/puppet.git/lib/puppet/transaction.rb:296:in `evaluate'
/home/happy/puppet.git/lib/puppet/util.rb:400:in `thinmark'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:293:in `measure'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:307:in `realtime'
/home/happy/puppet.git/lib/puppet/util.rb:399:in `thinmark'
/home/happy/puppet.git/lib/puppet/transaction.rb:295:in `evaluate'
/home/happy/puppet.git/lib/puppet/transaction.rb:289:in `collect'
/home/happy/puppet.git/lib/puppet/transaction.rb:289:in `evaluate'
/home/happy/puppet.git/lib/puppet/resource/catalog.rb:142:in `apply'
/home/happy/puppet.git/lib/puppet/configurer.rb:153:in `run'
/home/happy/puppet.git/lib/puppet/util.rb:178:in `benchmark'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:293:in `measure'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:307:in `realtime'
/home/happy/puppet.git/lib/puppet/util.rb:177:in `benchmark'
/home/happy/puppet.git/lib/puppet/configurer.rb:152:in `run'
/home/happy/puppet.git/lib/puppet/agent.rb:53:in `run'
/home/happy/puppet.git/lib/puppet/agent/locker.rb:21:in `lock'
/home/happy/puppet.git/lib/puppet/agent.rb:53:in `run'
/opt/TWWfsw/ruby18/lib/ruby/sync.rb:229:in `synchronize'
/home/happy/puppet.git/lib/puppet/agent.rb:53:in `run'
/home/happy/puppet.git/lib/puppet/agent.rb:130:in `with_client'
/home/happy/puppet.git/lib/puppet/agent.rb:51:in `run'
/home/happy/puppet.git/lib/puppet/application/puppetd.rb:103:in `onetime'
/home/happy/puppet.git/lib/puppet/application.rb:226:in `send'
/home/happy/puppet.git/lib/puppet/application.rb:226:in `run_command'
/home/happy/puppet.git/lib/puppet/application.rb:217:in `run'
/home/happy/puppet.git/lib/puppet/application.rb:306:in `exit_on_fail'
/home/happy/puppet.git/lib/puppet/application.rb:217:in `run'
sbin/puppetd:159
/home/happy/puppet.git/lib/puppet/provider/package/sun.rb:116:in `info2hash'
/home/happy/puppet.git/lib/puppet/provider/package/sun.rb:147:in `query'
/home/happy/puppet.git/lib/puppet/provider/package.rb:22:in `properties'
/home/happy/puppet.git/lib/puppet/type/package.rb:310:in `retrieve'
/home/happy/puppet.git/lib/puppet/type.rb:726:in `evaluate'
/home/happy/puppet.git/lib/puppet/transaction.rb:62:in `apply'
/home/happy/puppet.git/lib/puppet/transaction.rb:251:in
`eval_children_and_apply_resource'
/home/happy/puppet.git/lib/puppet/util.rb:400:in `thinmark'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:293:in `measure'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:307:in `realtime'
/home/happy/puppet.git/lib/puppet/util.rb:399:in `thinmark'
/home/happy/puppet.git/lib/puppet/transaction.rb:250:in
`eval_children_and_apply_resource'
/home/happy/puppet.git/lib/puppet/transaction.rb:207:in `eval_resource'
/home/happy/puppet.git/lib/puppet/transaction.rb:296:in `evaluate'
/home/happy/puppet.git/lib/puppet/util.rb:400:in `thinmark'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:293:in `measure'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:307:in `realtime'
/home/happy/puppet.git/lib/puppet/util.rb:399:in `thinmark'
/home/happy/puppet.git/lib/puppet/transaction.rb:295:in `evaluate'
/home/happy/puppet.git/lib/puppet/transaction.rb:289:in `collect'
/home/happy/puppet.git/lib/puppet/transaction.rb:289:in `evaluate'
/home/happy/puppet.git/lib/puppet/resource/catalog.rb:142:in `apply'
/home/happy/puppet.git/lib/puppet/configurer.rb:153:in `run'
/home/happy/puppet.git/lib/puppet/util.rb:178:in `benchmark'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:293:in `measure'
/opt/TWWfsw/ruby18/lib/ruby/benchmark.rb:307:in `realtime'
/home/happy/puppet.git/lib/puppet/util.rb:177:in `benchmark'
/home/happy/puppet.git/lib/puppet/configurer.rb:152:in `run'
/home/happy/puppet.git/lib/puppet/agent.rb:53:in `run'
/home/happy/puppet.git/lib/puppet/agent/locker.rb:21:in `lock'
/home/happy/puppet.git/lib/puppet/agent.rb:53:in `run'
/opt/TWWfsw/ruby18/lib/ruby/sync.rb:229:in `synchronize'
/home/happy/puppet.git/lib/puppet/agent.rb:53:in `run'
/home/happy/puppet.git/lib/puppet/agent.rb:130:in `with_client'
/home/happy/puppet.git/lib/puppet/agent.rb:51:in `run'
/home/happy/puppet.git/lib/puppet/application/puppetd.rb:103:in `onetime'
/home/happy/puppet.git/lib/puppet/application.rb:226:in `send'
/home/happy/puppet.git/lib/puppet/application.rb:226:in `run_command'
/home/happy/puppet.git/lib/puppet/application.rb:217:in `run'
/home/happy/puppet.git/lib/puppet/application.rb:306:in `exit_on_fail'
/home/happy/puppet.git/lib/puppet/application.rb:217:in `run'
sbin/puppetd:159
err: //gaview/Alert_sysadmin::Config[pig]/Package[TSSalert-sysadmin]: Failed to
retrieve current state of resource: Unable to get information about package
TSSalert-sysadmin because of: ERROR: information for "TSSalert-sysadmin" was
not found
This happens regardless of the package name--any package that is both
"absented" and not installed causes this backtrace. If it helps,
running '/usr/bin/pkginfo -l TSSalert-sysadmin' returns this with an
exit status of 1:
ERROR: information for "TSSalert-sysadmin" 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://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.