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

parse error on class parameters named default

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Cannot Reproduce
    • PUP 2.7.25
    • None
    • Compiler
    • None

    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

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support