You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are trying to use the value of a fact as a key for looking up another fact in a conditional. Inside the body of the conditional, we are trying to use the fact, and it is reporting as a syntax error, but it passes puppet parser validate
Minimal example that still signals syntax error seems to occur if there are square brackets in the conditional string. Note that the line that it fails on is the comment inside the
if $facts["[]"] {
#"${bar}"
}
This leads me to believe that there is some error in parsing the 'key' in the facts map, that causes some kind of downstream problems.
We can workaround this by storing the fact in a local variable, and using the local variable for any references within our class.
The text was updated successfully, but these errors were encountered:
Describe the Bug
We are trying to use the value of a fact as a key for looking up another fact in a conditional. Inside the body of the conditional, we are trying to use the fact, and it is reporting as a syntax error, but it passes
puppet parser validate
Initial example that caused it to fail
Error was on the line inside of the conditional where we were setting the service name.
I noticed that if I commented out the
service
line and made changes below it, I still got syntax errors on the commented line.Expected Behavior
Given usage of using a facts[] lookup as part of a facts lookup is valid consistent with
puppet parser validate
Steps to Reproduce
Steps to reproduce the behavior:
Environment
Additional Context
Minimal example that still signals syntax error seems to occur if there are square brackets in the conditional string. Note that the line that it fails on is the comment inside the
This leads me to believe that there is some error in parsing the 'key' in the facts map, that causes some kind of downstream problems.
We can workaround this by storing the fact in a local variable, and using the local variable for any references within our class.
The text was updated successfully, but these errors were encountered: