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

Future parser interpolation with [] after variable prefixed with underscore

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Done
    • PUP 3.7.5
    • PUP 3.8.0, PUP 4.1.0
    • Language
    • None
    • 1
    • Language 2015-04-15
    • Bug Fix

    Description

      When a variable containing a hash has a name prefixed with an underscore:

      $_foo = {
        'a' => 'b',
      }
      notify { "${_foo['a']}": }
      

      and run `puppet apply --parser=future` you get the following error:

      Error: Evaluation Error: The value 'a' cannot be converted to Numeric. on node uagent2.corp.puppetlabs.net
      Error: Evaluation Error: The value 'a' cannot be converted to Numeric. on node uagent2.corp.puppetlabs.net
      

      That looks like it might be assuming that the hash is an array?

      The following applies without error:

      $foo = {
        'a' => 'b',
      }
      notify { "${foo['a']}": }
      

      This fails with the future parser on puppet 3.7.5, and also fails against master (at 7ba7ae8f3b221896a3b77beb6778b7a895671c7d)

      Attachments

        1. log
          12 kB
          Kurt Wall

        Issue Links

          Activity

            People

              Unassigned Unassigned
              morgan Morgan Rhodes
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support