Bug #11984

improperly configured storeconfigs do not return valuable exit codes

Added by Justin Stoller 4 months ago. Updated 4 months ago.

Status:Accepted Start date:01/17/2012
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:stored configuration
Target version:-
Affected Puppet version:2.7.9 Branch:
Keywords:exit codes, storeconfigs
Votes: 0

Description

Noticed this while writing tests:


root@ubuntu-beta:~# puppet --version
2.7.9

root@ubuntu-beta:~# puppet apply --detailed-exitcodes -e '@@notify { "$hostname": tag => "storeconfgs" }'
warning: You cannot collect without storeconfigs being set on line 1
notice: Finished catalog run in 0.03 seconds

root@ubuntu-beta:~# echo $?
0

as well as


root@ubuntu-beta:~# puppet apply --detailed-exitcodes -e "Notify <<| tag == 'storeconfig_test' |>>"
warning: You cannot collect exported resources without storeconfigs being set; the collection will be ignored on line 1
warning: Not collecting exported resources without storeconfigs
notice: Finished catalog run in 0.03 seconds

root@ubuntu-beta:~# echo $?
0

checking


* --detailed-exitcodes:
  Provide transaction information via exit codes. If this is enabled, an exit
  code of '2' means there were changes, an exit code of '4' means there were
  failures during the transaction, and an exit code of '6' means there were both
  changes and failures.

From reading this I was expecting, if not a 1, at least a 4 as the exit code.


Related issues

related to Puppet - Bug #7078: resource_type search can produce errors if storedconfigs ... Accepted 04/13/2011

History

Updated by Daniel Pittman 4 months ago

  • Status changed from Unreviewed to Accepted

Updated by Daniel Pittman 4 months ago

  • Target version deleted (2.7.x)

Updated by Peter Meier 4 months ago

Imho it is fine if the exit code 0, as it is only a warning and imho it actually doesn’t happen during a transaction, but rather at compile time.

Related is also the discussion in #7078 Where the long standing request was discussed to not pollute the output with tons of such warnings. If we do any changes we should imho address both discussions at once. Otherwise things will get messier.

Also available in: Atom PDF