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

Case regexp option silently skips numbers in future parser.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Won't Fix
    • Affects Version/s: PUP 3.6.2
    • Fix Version/s: None
    • Component/s: Compiler
    • Labels:
    • Environment:

      Occurs on AWS on Amazon Linux distribution.

    • Template:

      Description

      It seems the way regular expressions are now parsed has been changed and I presume it wasn't on purpose.

      Here's how it used to work before and what I consider as expected:

      On 3.4.3

      [ec2-user@instance-CN5L5XeZKd ~]$ cat test.pp
      $test = 1
       
      case $test {
        /^\d+$/: {
          fail('MATCH')
        }
        default: {
          fail("Not MATCH")
        }
      }
      [ec2-user@instance-CN5L5XeZKd ~]$ puppet apply test.pp
      Error: MATCH at /home/ec2-user/test.pp:5 on node instance-cn5l5xezkd.us-west-1.compute.internal
      Error: MATCH at /home/ec2-user/test.pp:5 on node instance-cn5l5xezkd.us-west-1.compute.internal
      [ec2-user@instance-CN5L5XeZKd ~]$ gem list puppet
       
      *** LOCAL GEMS ***
       
      puppet (3.4.3)
      [ec2-user@instance-CN5L5XeZKd ~]$ ruby -v
      ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]
      [ec2-user@instance-CN5L5XeZKd ~]$
      

      And here we have do the same on Puppet 3.6.2:

      On 3.6.2

      [root@puppetmaster ~]# cat test.pp
      $test = 1
       
      case $test {
        /^\d+$/: {
          fail('MATCH')
        }
        default: {
          fail("Not MATCH")
        }
      }
      [root@puppetmaster ~]# puppet apply test.pp
      Error: Not MATCH on node puppet
      Error: Not MATCH on node puppet
      [root@puppetmaster ~]# gem list puppet
       
      *** LOCAL GEMS ***
       
      puppet (3.6.2)
      puppet_forge (1.0.3)
      [root@puppetmaster ~]# ruby -v
      ruby 2.0.0p451 (2014-02-24 revision 45167) [x86_64-linux]
      

      Please, let me know if there's any additional info I can provide you with to solve this problem.

        Attachments

          Activity

            People

            Assignee:
            andy Andrew Parker
            Reporter:
            zylad Dominik Zyla
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support