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

Concatenating an optional array results in 'undef'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Do
    • Affects Version/s: PUP 4.9.2
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
      None
    • Template:
    • QA Risk Assessment:
      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

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

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support