Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-9005

epp template fails to translate <%= ... %> when it is followed by a left parenthesis

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Cannot Reproduce
    • Affects Version/s: PUP 4.10.12
    • Fix Version/s: None
    • Component/s: Language
    • Labels:
      None
    • Environment:
    • QA Risk Assessment:
      Needs Assessment

      Description

      See https://groups.google.com/d/msg/puppet-users/pQC6AspIC4M/a1KzBXjqBgAJ

      Given the following code:

      <%- | Hash $openvpnConf, String $openvpnMode, String $instance| -%>
      <% ({
      'Mode' => [
       "$openvpnMode",
      ],
      }).each |$category, $parameters| { -%>
      ### <%= $category %> ###
      <% $parameters.each |$parameter| { -%>
      <% if $parameter == 'remote' { -%>
      <%= $parameter %> <%= $openvpnConf['server'] %> <%= $openvpnConf['port'] %>
      <% } else { -%>
      <%= $parameter %> <%= $openvpnConf[$parameter] %>
      <% } -%>
      <% } %>
      

      Adding anything between

      <%- | Hash $openvpnConf, String $openvpnMode, String $instance | -%>
      

      and

      <% ({
      'Mode' => [
      

      throws an error. As example:

      <%- | Hash $openvpnConf, String $openvpnMode, String $instance | -%> 
      *<%= $openvpnMode %>* 
      <% ({ 
      'Mode' => [ 
              "$openvpnMode", 
      ],
       

      Results in
      Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Function Call, epp(): Invalid EPP: Ambiguous EPP parameter expression. Probably missing '<%-' before parameters to remove leading whitespace at /etc/puppetlabs/code/modules/openvpn/templates/etc/openvpn/config.epp:2:20 at /etc/puppetlabs/code/modules/openvpn/manifests/init.pp:29:22 on node h2786452.stratoserver.net
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:269:in `is_http_200?'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/rest.rb:167:in `find'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:194:in `find'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:439:in `block in retrieve_new_catalog'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:507:in `block in thinmark'
      /opt/puppetlabs/puppet/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:506:in `thinmark'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:438:in `retrieve_new_catalog'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:78:in `retrieve_catalog'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:147:in `prepare_and_retrieve_catalog'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:309:in `run_internal'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:221:in `block in run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/context.rb:65:in `override'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet.rb:306:in `override'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/configurer.rb:195:in `run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:58:in `block (5 levels) in run'
      /opt/puppetlabs/puppet/lib/ruby/2.1.0/timeout.rb:75:in `timeout'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:57:in `block (4 levels) in run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent/locker.rb:21:in `lock'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:51:in `block (3 levels) in run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:118:in `with_client'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:48:in `block (2 levels) in run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:85:in `run_in_fork'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:47:in `block in run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `call'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:179:in `controlled_run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/agent.rb:45:in `run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:360:in `onetime'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application/agent.rb:338:in `run_command'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `block in run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util.rb:662:in `exit_on_fail'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/application.rb:375:in `run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:132:in `run'
      /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/command_line.rb:72:in `execute'
      /opt/puppetlabs/puppet/bin/puppet:5:in `<main>'are also helpful.

      The template is called via

      content => epp("openvpn/etc/openvpn/config.epp", \{ openvpnConf => $openvpnConf, openvpnMode => $openvpnMode, instance => $instance }),
      

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                Helmut Helmut Ritter
                Reporter:
                Helmut Helmut Ritter
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: