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

augeas resource type set service-name bug when specifying a port with 5 digits

    XMLWordPrintable

    Details

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

      customer report is on PE 2018.1.0

      I have tested in PE 2019.1.1 and PE2019.1.0 agents

    • Template:
    • Team:
      Night's Watch
    • Story Points:
      3
    • Sprint:
      NW - 2020-11-25
    • Method Found:
      Needs Assessment
    • Zendesk Ticket IDs:
      37467
    • Zendesk Ticket Count:
      1
    • Release Notes:
      Not Needed
    • QA Risk Assessment:
      Needs Assessment

      Description

      Puppet Version: 2019.1.1, 2018.1.0
      Puppet Server Version: 6.3.1, 5.5.1
      OS Name/Version: RHEL 7

      Steps to reproduce:
      1. create the following test.pp file:

      augeas

      { 'controlm': context => '/files/etc/services', changes => [ "set service-name[port = '7005'][protocol = 'udp'] henryctmagent", "set service-name[port = '7005'][protocol = 'udp']/#comment 'server2agent'", ] }

      using pupppet apply text.pp -d to run and it will succeed. I can see the corresponding service is created under /etc/services.

      2. However, whenever specifying a port with 5 digits, such as 17000, it will throw the following error:

      Debug: Augeas[controlm](provider=augeas): /augeas/files/etc/services/error/message = Failed to match tree under /files/etc/services/service-name[11058]

      with pattern  

      (

      { /port/ = /[0-9]+/ }
      { /start/ = /[0-9]+/ }

      { /end/ = /[0-9]+/ }

      )

      { /protocol/ = /[A-Za-z]+/ }

      (

      { /alias/ = /[*+.-:A-Z_a-z-]+/ }

      )*
      (

      { /#comment/ = /[^\t\n\r ].*[^\t\n\r ]|[^\t\n\r ]/ }
      ())

      The rule is not being added as a result.

      Desired Behavior: As long as the port is available, the rule should be added successfully no matter if the port is a 5 digits number.

       

       

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              luchian.nemes Luchian Nemes
              Reporter:
              henry.wang Henry Wang
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support