puppetlabs/puppet — pull request #501 by kelseyhightower (2012-02-15 05:19:09+00:00)
Title: Ticket/2.7.x/12645 face actions should have the ability to set specific exit codes

Before this patch Face actions do not have the ability to set specific
exit codes. The only way to set a non-zero exit code is to raise an
exception, which sets the exit code to 1.

This patch provides the ability for Face actions to set specific exit
codes by simply calling `Kernel::exit`.

Example:

exit(2)

Calling `Kernel::exit` raises a SystemExit exception which we rescue in
the `Puppet::Application::FaceBase` class -- the base class of all
Faces, which updates the status variable used to set the exit code later
on.

This patch also includes updated specs related to this change.