Use tab for whitespace when checking sysctl output #60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When outputing a value the sysctl utility will print tabs for
whitespace, rather than space characters. Users, however, will commonly
use spaces rather than tabs when specifying their values.
Prior to this commit, the discrepancy between user input and sysctl
output caused idempotency problems when Puppet was enforcing sysctl
settings such as the following:
Puppet would run
sysctl -n kernel.sem
which would output with tabs:It would then compare this value to the user input, which had spaces:
Finding the two values to be different, Puppet would faithfully run
sysctl to "fix" the out-of-sync setting.
This commit fixes the problem by having Puppet compare the output of
sysctl with a tab-whitespace version of the user input, even if the user
specified spaces.
This logic (whitespace normalization) has also been used to fix the
problem in several other Puppet sysctl modules.