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

Concatenating an optional array results in 'undef'

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Won't Do
    • PUP 4.9.2
    • None
    • Compiler
    • None
    • Needs Assessment

    Description

      See the example class below:

      class arrayjank (
        Optional[Array[String,1]] $extra_members = undef
      ) {
        $base_members = ['one','two','three']
        $members = $base_members + $extra_members
        notify { $members: }
      }
      

      The notify will error with the following message:

      Error: Evaluation Error: Missing title at index 3. The title expression resulted in an undef title at /home/.../test.pp:6:12 on node ...
      

      The '+' operator should append nothing if the second array is undef.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nickmillerop Nick Miller
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support