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

Bug #5668

puppet resource exits with 0 despite failing to do as commanded

Added by Daniel Pittman over 3 years ago. Updated about 2 years ago.

Status:AcceptedStart date:12/24/2010
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:ralsh
Target version:3.x
Affected Puppet version:development Branch:
Keywords:

We've Moved!

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

This ticket may be automatically exported to the PUP project on JIRA using the button below:


Description

The following ‘puppet resource’ invocation improperly returns 0 in my testing:

] puppet resource host test target=/tmp/whatever; echo $?
notice: /Host[test]/ensure: created
err: /Host[test]: Could not evaluate: ip is a required attribute for hosts
host { 'test':
    ensure => 'present',
    target => '/tmp/hosts-1744'
}
0

It does correctly report that there is a required attribute missing (ip), but the exit code is zero.

The usual behavior of a tool like this would be to exit with an error code indicating that something did not work, so that it could be driven by other automation solutions.

History

#1 Updated by James Turnbull about 3 years ago

  • Status changed from Unreviewed to Accepted

#2 Updated by Nigel Kersten about 2 years ago

  • Target version set to 3.x

Also available in: Atom PDF