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

Description of split function states wrong usage example with data type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 4.3.2
    • Fix Version/s: PUP 4.4.0
    • Component/s: None
    • Labels:
      None
    • Template:
    • Story Points:
      1
    • Sprint:
      Language 2016-03-09
    • Release Notes:
      Not Needed
    • Release Notes Summary:
      Trivial typo in documentation of split function.

      Description

      The Puppet 4 style split function states within the documentation that one can use a Regexp data type:
      $array_var3 = split($string, Regexp('[.:]'))

      Using the example within a puppet manifest:

      $version='1.8.0_72'
      $array=split($version, Regexp('[._]'))
      $maj=$array[0]
      $min=$array[1]
      $patch = $array[2]
      $minpatch = $array[3]
      notify { "Version: ${version}": }
      notify { "Major, Min, Patch, MinPatch: ${maj} - ${min} - ${patch} - ${minpatch}": }
      

      Results in the following error message:

      Error: Could not parse for environment production: Illegal expression. A Type-Name is unacceptable as function name in a Function Call at /root/split.pp:2:24 on node puppetmaster.example.net
      

      Puppet Version:

      puppet --version
      4.3.2
      

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            malfke Martin Alfke
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support