Skip to content
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

(PUP-5824) Support empty interpolation in Hiera data provider #4637

Conversation

thallgren
Copy link
Contributor

Before this, an empty interpolation such as %{} was not considered
an interpolation at all. The interpolation regexp required at least one
character between the curly braces.

This commit will allow the empty interpolation and will also ensure
that the expression between the curly braces is trimmed from whitespace
at both ends. If the result of that trim yields the empty string or
a string that only contains a name separator '::', then the interpolated
result will be the empty string.

It is still possible to have interpolated expressions where the key has
leading or trailing whitespace by using the function syntax, e.g.
%{hiera(' key ')}.

Before this, an empty interpolation such as `%{}` was not considered
an interpolation at all. The interpolation regexp required at least one
character between the curly braces.

This commit will allow the empty interpolation and will also ensure
that the expression between the curly braces is trimmed from whitespace
at both ends. If the result of that trim yields the empty string or
a string that only contains a name separator '::', then the interpolated
result will be the empty string.

It is still possible to have interpolated expressions where the key has
leading or trailing whitespace by using the function syntax, e.g.
%{hiera(' key ')}.
hlindberg added a commit that referenced this pull request Feb 5, 2016
…of-empty-variable

(PUP-5824) Support empty interpolation in Hiera data provider
@hlindberg hlindberg merged commit 4e3dcab into puppetlabs:stable Feb 5, 2016
@thallgren thallgren deleted the issue/pup-5824/interpolation-of-empty-variable branch February 8, 2016 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants