Maint: Add an assertion mechanism to Puppet
This patch allows us to make C-style "assertions" in Puppet code,
e.g.:
assert_that { condition }
assert_that(message) { condition }
These methods will raise an exception if the environment variable
PUPPET_ENABLE_ASSERTIONS is set to a non-empty value, and the the
condition evaluates to false. If the environment variable
PUPPET_ENABLE_ASSERTIONS is not set, then the condition is not even
checked.
Switching the assertions on with PUPPET_ENABLE_ASSERTIONS carries
three advantages:
- It makes it possible to put potentially expensive checks in
assertions without degrading the performance of the code in production
environments.
- It allows strict assertions to catch Puppet bugs early in
development, without increasing the risk of a crash in production
environments.
- It allows a simple command-line mechanism to run any Puppet command
with assertions enabled.