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

puppet epp render fails on valid templates

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.7.0, PUP 4.9.4, PUP 4.10.4
    • Fix Version/s: PUP 4.10.5, PUP 5.0.1
    • Component/s: Language
    • Labels:
      None
    • Template:
    • Acceptance Criteria:
      Hide

      puppet epp render should not fail on valid templates

      puppet epp render output should match results from puppet apply of the template

      Show
      puppet epp render should not fail on valid templates puppet epp render output should match results from puppet apply of the template
    • Sub-team:
    • Team:
      Agent
    • Story Points:
      1
    • Sprint:
      Agent 2017-06-28, Agent 2017-07-12
    • Method Found:
      Needs Assessment
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      A regression in PUP 4.7.0 made the command {{epp render}} fail loading 4.x functions when evaluating a template. The same template would work fine when used in a manifest.
    • QA Risk Assessment:
      Manual

      Description

      puppet apply is able to parse/render template data where puppet epp render fails.

      puppet apply /tmp/foo.pp -v
      Info: Applying configuration version '1498149368'
      Notice: /Stage[main]/Main/File[/tmp/epp_file.txt]/ensure: defined content as '{md5}b5648129ac61afe0f9ffdaac69db3b75'
      Notice: /Stage[main]/Main/File[/tmp/epp_inline.txt]/ensure: defined content as '{md5}b5648129ac61afe0f9ffdaac69db3b75'
      Notice: Applied catalog in 0.01 seconds
      

      puppet epp render /tmp/foo.epp --trace
      Error: Evaluation Error: Error while evaluating a Method call, each(): Wrong number of arguments given (1 for minimum 2) at /tmp/foo.epp:2:9
      Error: error while rendering epp
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/face/epp.rb:345:in `block (3 levels) in <top (required)>'
      /usr/local/opt/rbenv/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/interface/action.rb+eval[wrapper]:242:in `render'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/application/face_base.rb:252:in `main'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/application.rb:366:in `run_command'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/application.rb:358:in `block in run'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/util.rb:542:in `exit_on_fail'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/application.rb:358:in `run'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/util/command_line.rb:132:in `run'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/lib/puppet/util/command_line.rb:72:in `execute'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/gems/puppet-4.10.4/bin/puppet:5:in `<top (required)>'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/bin/puppet:23:in `load'
      /usr/local/Cellar/rbenv/1.1.0/versions/2.3.1/gemsets/solaris_providers/bin/puppet:23:in `<main>'
      Error: Try 'puppet help epp render' for usage
      

      The following manifest will create the test condition.
      After application puppet epp render /tmp/foo.epp fails

      $foo_epp=@(END)
      <% $data = ["routers", "servers", "workstations"] -%>
      <% $data.each |$value| { %>
        <%= $value %>
      <% } -%>
      END
       
      # Can't actually create the template here the catalog compilation fails
      # file { "/tmp/foo.epp":
      #   ensure   => file,
      #   content  => $foo_epp,
      # }
       
      file { "/tmp/epp_file.txt":
       ensure    => file,
       content   => epp('/tmp/foo.epp')
      }
       
      file { "/tmp/epp_inline.txt":
        ensure   => file,
        content  => inline_epp($foo_epp)
      }
      
      

        Attachments

          Activity

            People

            Assignee:
            john.duarte John Duarte
            Reporter:
            shawnferry Shawn Ferry
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support