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

parse error on class parameters named default

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Cannot Reproduce
    • Affects Version/s: PUP 2.7.25
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None
    • Template:

      Description

      It seems that under 2.7.x (or at least 2.7.25) it is valid to define a class in the DSL with a parameter named default but it is invalid to declare a class with a parameter of the same name. Eg.

      $ be puppet --version
      2.7.25
      $ be puppet apply -e 'class foo($default = "foo") { notify{$default:} } class

      {foo:}

      '
      notice: foo
      notice: /Stage[main]/Foo/Notify[foo]/message: defined 'message' as 'foo'
      notice: Finished catalog run in 0.04 seconds
      $ be puppet apply -e 'class foo($default = "foo") { notify{$default:} } class

      { foo: 'default' => "baz"}

      '
      Could not parse for environment production: Syntax error at 'default'; expected '}' at line 1 on node leo.tuc.noao.edu

      Note that be == bundle exec

        Attachments

          Activity

            jsd-sla-details-panel

              People

              • Assignee:
                andy Andrew Parker
                Reporter:
                jhoblitt Joshua Hoblitt
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: