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

Description of split function states wrong usage example with data type

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • PUP 4.3.2
    • PUP 4.4.0
    • None
    • None
    • 1
    • Language 2016-03-09
    • Not Needed
    • 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

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

            Dates

              Created:
              Updated:
              Resolved:

              Zendesk Support