-
Notifications
You must be signed in to change notification settings - Fork 193
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(MODULES-3951) Add explicit check for stringify_facts #170
Conversation
Without this check, you get incomprehensible results. The is_pe fact is evaluated as true, and so the class bails out. In some cases the info() function isn't loud enough and so it appears to do nothing. This just fails hard and makes it obvious why.
7a0d5a2
to
1687132
Compare
Would be nice to get a spec test for this. |
CLA signed by all contributors. |
@glennsarti I'd be happy to, but I couldn't think of a non-trivial test, and I haven't spent time figuring out how to set up a beaker test with config settings. :-/ |
A simple spec test should be sufficient. Mock the facts and expect a fail. |
Previously there were no tests for the stringify_facts fact. This commit adds unit tests for this fact by mocking the Puppet.settings values. This commit also adds a test to ensure that catalog compilation fails if stringify_facts evaluates as true.
d03afaa
to
251e8ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was already done (albeit less-cleanly) here: https://github.com/puppetlabs/puppetlabs-puppet_agent/blob/master/manifests/prepare/ssl.pp#L48-L50
This PR should probably also remove that check, since stringify_facts
will now explicitly be checked
Is it possible for that code path to be triggered by something other than stringify = true? |
@glennsarti Only if a user also has their own custom fact called 6fb63a0 is the actual commit - the entire |
Excellent...I can revert those. Thanks |
@branan travis has completed with the changes you requested. Can you please review once more and approve once you're happy. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All looks good now! Thanks for taking care of that
CLA signed by all contributors. |
Without this check, you get incomprehensible results. The is_pe fact is
evaluated as true, and so the class bails out. In some cases the
info() function isn't loud enough and so it appears to do nothing.
This just fails hard and makes it obvious why.