Detailed exit codes in facter

68 views
Skip to first unread message

Will Hopper

unread,
Jul 8, 2016, 5:38:25 PM7/8/16
to Puppet Developers
Hey all,

As brought up by https://tickets.puppetlabs.com/browse/FACT-1429, facter currently returns an exit code of 0 when a non-existent fact is queried. Thus, it's not possible to distinguish between a successful query and a silent failure other than by actually reading the output.

To improve on this, facter should produce meaningful exit codes. For backwards compatibility, we're thinking about adding a `--detailed-exitcodes` option. Our questions for the community are: are there other scenarios you'd like to see exit codes better utilized for? And, are there specific codes would you like to see for these scenarios, including our example non-existent fact query?

Thanks!

--
William Hopper
Puppet Platform Engineer

Rob Nelson

unread,
Jul 8, 2016, 5:44:00 PM7/8/16
to puppe...@googlegroups.com
Will, I don't have any specific needs myself but there are probably two other detailed exit codes I can envision. 1) there was a problem calculating the value of the requested fact. 2) there was a problem calculating the value of one or more facts, but at least one fact's value was successfully calculated (most likely when used without a fact name in the argument list). The latter I observed on switch gear where individual facts that were not properly confined would fail to calculate because some unix-ism was not present in the unix-ish OS.

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-dev+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-dev/cd25a8bd-a686-4432-9756-d4f4208cd7a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages