bartavelle / language-puppet

A library to work with Puppet manifests, test them and eventually replace everything ruby.
BSD 3-Clause "New" or "Revised" License
51 stars 8 forks source link

Annoying error message when using double quotes with lookupvar in erb #278

Open PierreR opened 5 years ago

PierreR commented 5 years ago

Such erb template :

<%= scope.lookupvar("zookeeper::id") %>

will lead to such an error:

CRITICAL: At ./modules/zookeeper/manifests/config.pp:53:12 the evaluation of template './modules/zookeeper/templates/conf/myid.erb' failed. Can't evaluate ScopeObject (Value (Interpolable [Value (Literal "zookeeper::id")]))

This is solved if we replace the double quotes with single quotes:

<%= scope.lookupvar('zookeeper::id') %>
bartavelle commented 5 years ago

Did you fix it? I can't really reproduce it now.

PierreR commented 5 years ago

I haven't. I only changed the log level to error instead of critical.

bartavelle commented 5 years ago

Hum, I can't reproduce it, but I shipped a very small simplification to the parser. Can you send me a minimal example that exhibits de problematic behavior?

PierreR commented 5 years ago

I can confirm that it is your latest commit that makes the error message to disappear. In other words, I can't reproduce the issue since your latest commit. I can if I use 8f8f4127916aeea3c18c4d77652d663b1bc4abef. Is this a good sign ?