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

New evaluator does not properly handle resource defaults

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 3.5.0
    • Fix Version/s: PUP 3.6.0
    • Component/s: Compiler
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Week 2014-4-23 to 2014-4-30, Week 2014-4-30 to 2014-5-7

      Description

      Resource defaults in the new evaluator appear to not be working for defined resource types.

      Testing manifest

      define testing::thing($msg = 'param default') {
        notify { 'name': message => $msg }
      }
       
      Testing::Thing  {
          msg => 'resource default'
      }
       
      testing::thing { 'name': }
      

      If the above code is run with the new evaluator, then it will output param default rather than the expected resource default.

      Incorrect message when using new evaluator

      > be puppet apply t.pp --parser future --evaluator future
      Warning: Could not retrieve fact fqdn
      Notice: Compiled catalog for aparker in environment production in 0.41 seconds
      Notice: param default
      Notice: /Stage[main]/Main/Testing::Thing[name]/Notify[name]/message: defined 'message' as 'param default'
      Notice: Finished catalog run in 0.04 seconds
      

      Simply changing to use the old evaluator gets the expected output.

      Correct message when using old evaluator

      > be puppet apply t.pp --parser future --evaluator current
      Warning: Could not retrieve fact fqdn
      Notice: Compiled catalog for aparker in environment production in 0.41 seconds
      Notice: resource default
      Notice: /Stage[main]/Main/Testing::Thing[name]/Notify[name]/message: defined 'message' as 'resource default'
      Notice: Finished catalog run in 0.05 seconds
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                andy Andrew Parker
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Zendesk Support