Closed PierreR closed 5 years ago
Should work better now ...
Would it be possible to keep the CRITICAL message but not the error in case of <% @facts['ipaddress'] %>
?
CRITICAL: At ./modules/application/manifests/docker/kafka.pp:9:5 the evaluation of template './modules/application/templates/kafka/docker-compose.erb' failed. Eval not implemented
ERROR: (docker.kafka.dev) undefined method `[]' for nil:NilClass
(erb):12:in `get_binding'
/nix/store/vna6y0b2s5v6glj0kkrxn95a7mcxz8jh-ruby-2.4.4/lib/ruby/2.4.0/erb.rb:896:in `eval'
/nix/store/vna6y0b2s5v6glj0kkrxn95a7mcxz8jh-ruby-2.4.4/lib/ruby/2.4.0/erb.rb:896:in `result'
/nix/store/s1hnsq31ak61gcwsqzipkv51z28s7yv8-language-puppet-1.4.0-data/share/ghc-8.4.3/x86_64-linux-ghc-8.4.3/language-puppet-1.4.0/ruby/hrubyerb.rb:117:in `runFromContent'
/nix/store/s1hnsq31ak61gcwsqzipkv51z28s7yv8-language-puppet-1.4.0-data/share/ghc-8.4.3/x86_64-linux-ghc-8.4.3/language-puppet-1.4.0/ruby/hrubyerb.rb:113:in `runFromFile'
in ./modules/application/templates/kafka/docker-compose.erb at ./modules/application/manifests/docker/kafka.pp:9:5
Oh I did not think of this! I think the best thing to do would be to have the parser fail, so that it would fall back to the ruby backend.
I made the parser fail on statements. It should be alright now.
Have you had a chance to look at the failing test ?
"Eval not implemented" is now just a log "INFO". I am not sure what do to about this but in this case it would be quite handy to have a WARNING.
It should use the actual ruby interpreter and produce the correct result, so I do not think this should be a warning (it is the expected behaviour).
Given an erb file with such a line (note the missing equal after
<%
)puppetresources ( with the --showfile option) will happily display the ipddress facts:
whereas puppet will generate this: