Issue #18937 has been updated by eric sorenson. Status changed from Unreviewed to Accepted Keywords set to errors
This seems to happen because puppet resource treats the 'save' call against the resource it creates as primarily a means to output DSL code , and only secondarily to actually change the state of the system. The result of the save is never checked nor an error bubbled up, it just prints whatever the save returns and drops out of the block. Relating this to the general error-handling bug for a sweep ... <pre> lib/puppet/application/resource.rb 216 if name 217 if params.empty? 218 [ Puppet::Resource.indirection.find( key ) ] 219 else 220 resource = Puppet::Resource.new( type, name, :parameters => params ) 221 222 # save returns [resource that was saved, transaction log from applying the resource] 223 save_result = Puppet::Resource.indirection.save(resource, key) 224 [ save_result.first ] 225 end </pre> ---------------------------------------- Bug #18937: puppet resource returns zero exit code despite failing to deliver results https://projects.puppetlabs.com/issues/18937#change-90772 * Author: Daniel Pittman * Status: Accepted * Priority: Normal * Assignee: * Category: ralsh * Target version: * Affected Puppet version: * Keywords: errors * Branch: ---------------------------------------- <pre> root@razor-sut-ubuntu-1204-64:~# puppet --version 3.0.2 </pre> As you will see below, `puppet resource` exists zero despite failing to deliver my requested change. This makes it pretty hard to drive this from anything but a human sitting at a desk, which kind of sucks, honestly. <pre> root@razor-sut-ubuntu-1204-64:~# puppet resource package puppet-razor ensure=17.4 Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install puppet-razor=17.4' returned 100: Reading package lists... Building dependency tree... Reading state information... E: Version '17.4' for 'puppet-razor' was not found Error: /Package[puppet-razor]/ensure: change from 0.7.0.174-1puppetlabs1 to 17.4 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install puppet-razor=17.4' returned 100: Reading package lists... Building dependency tree... Reading state information... E: Version '17.4' for 'puppet-razor' was not found package { 'puppet-razor': ensure => '0.7.0.174-1puppetlabs1', } root@razor-sut-ubuntu-1204-64:~# echo $? 0 root@razor-sut-ubuntu-1204-64:~# puppet resource package puppet-razor ensure=absent Notice: /Package[puppet-razor]/ensure: removed package { 'puppet-razor': ensure => 'absent', } root@razor-sut-ubuntu-1204-64:~# puppet resource package puppet-razor ensure=17.4 Error: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install puppet-razor=17.4' returned 100: Reading package lists... Building dependency tree... Reading state information... E: Version '17.4' for 'puppet-razor' was not found Error: /Package[puppet-razor]/ensure: change from absent to 17.4 failed: Could not update: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold --force-yes install puppet-razor=17.4' returned 100: Reading package lists... Building dependency tree... Reading state information... E: Version '17.4' for 'puppet-razor' was not found package { 'puppet-razor': ensure => 'absent', } root@razor-sut-ubuntu-1204-64:~# echo $? 0 </pre> -- 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 unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/puppet-bugs?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
