Issue #19033 has been updated by Jeff McCune. Status changed from Accepted to Needs Decision
> I would expect that “non-detailed exit codes” would still include 1 for the > case of a failure to apply the catalog. I agree, puppet should fail with a non-zero exit status in the event that the catalog fails to be applied. Based on what you've described, however, this is not the case. Puppet has applied the catalog, a single resource in the catalog reported a failure. Before we accept this as an issue I need a bit more information about the use case and why a non-zero exit status is necessary when one or more resources cannot be brought into sync with the catalog. At a high level, I think the default non-zero exit status is reserved for more critical issues in the application itself, such as "could not retrieve catalog" or "certificate verification failed." Why is `--detailed-exit-codes` an insufficient solution to the problem you're facing? -Jeff ---------------------------------------- Bug #19033: Exit status is 0, even in the presence of errors, without --detailed-exitcodes https://projects.puppetlabs.com/issues/19033#change-82602 Author: Michael Armida Status: Needs Decision Priority: Normal Assignee: Category: error reporting Target version: Affected Puppet version: 2.7.18 Keywords: Branch: When an error is encountered while running either `puppet apply` or `puppet agent`, the program exits with status 0. If `--detailed-exitcodes` is used with `puppet agent`, the status is nonzero as expected. I would expect that "non-detailed exit codes" would still include 1 for the case of a failure to apply the catalog. You can recreate this with the following manifest: <pre> exec { 'false': command => '/bin/false', } </pre> Example run: <pre> marmida@monolith:~$ puppet apply fail_manifest.py warning: Could not retrieve fact fqdn err: /Stage[main]//Exec[false]/returns: change from notrun to 0 failed: /bin/false returned 1 instead of one of [0] at /home/marmida/fail_manifest.py:3 notice: Finished catalog run in 0.14 seconds marmida@monolith:~$ echo $? 0 marmida@monolith:~$ puppet apply fail_manifest.py --detailed-exitcodes warning: Could not retrieve fact fqdn err: /Stage[main]//Exec[false]/returns: change from notrun to 0 failed: /bin/false returned 1 instead of one of [0] at /home/marmida/fail_manifest.py:3 notice: Finished catalog run in 0.13 seconds marmida@monolith:~$ echo $? 4 </pre> The same problems occur in `puppet agent`. I couldn't find another issue specific to the exit status, but I did notice it mentioned once here: http://projects.puppetlabs.com/issues/14458#note-6 -- 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.
