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

Parameters on exported resources consiting of an array with a single element are "de-arrayified"

    XMLWordPrintable

    Details

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

      Description

      If a exported resource with a parameter consisting of an array with a single value is defined on one puppet node and then collected on another puppet node the array with the single value is "de-arrayified".

      Example:

      define profiles::vres (
        $dummy,
      ) {
        if is_array($dummy) {
          notify { "array_$title":
            message => join($dummy, '_'),
          }
        } else {
          notify { "nonarray_$title":
            message => "NOT AN ARRAY: $dummy",
          }
        }
      }
      

      on one server:

      @@profiles::vres { "arraywithonevalue":
          dummy => [ "a", ],
      }
      

      on another server:

      Profiles::Vres <<| |>>
      

      result of collecting the resource:

      Notice: NOT AN ARRAY: a
      Notice: /Stage[main]/Roles::Collectvres/Profiles::Vres[arraywithonevalue]/Notify[nonarray_arraywithonevalue]/message: defined 'message' as 'NOT AN ARRAY: a'
      

      This is probably related to PUP-1299

        Attachments

          Activity

            People

            Assignee:
            vicinus Reinhard Vicinus
            Reporter:
            vicinus Reinhard Vicinus
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support