Jira (PUP-11515) Negative Lookbehind Regex Causes Duplicate Node Definition Errors

10 views
Skip to first unread message

Maggie Dreyer (Jira)

unread,
Apr 21, 2022, 2:16:02 PM4/21/22
to puppe...@googlegroups.com
Maggie Dreyer moved an issue
 
Puppet / Bug PUP-11515
Negative Lookbehind Regex Causes Duplicate Node Definition Errors
Change By: Maggie Dreyer
Component/s: Puppet Server
Key: SERVER PUP - 3179 11515
Project: Puppet Server
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.20.2#820002-sha1:829506d)
Atlassian logo

Josh Cooper (Jira)

unread,
Apr 22, 2022, 7:15:03 PM4/22/22
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11515
 
Re: Negative Lookbehind Regex Causes Duplicate Node Definition Errors

Thanks for the detailed report. The problem is due to the way puppet keeps track of "regex" types of node names here. Both regexp are normalized to the same string:

irb(main):005:0> @name = /(?<!a)sync/
=> /(?<!a)sync/
irb(main):006:0> "__node_regexp__#{@name.source.downcase.gsub(/[^-\w:.]/,'').sub
(/^\.+/,'')}"
=> "__node_regexp__async"
irb(main):007:0> @name = /async/
=> /async/
irb(main):008:0> "__node_regexp__#{@name.source.downcase.gsub(/[^-\w:.]/,'').sub
(/^\.+/,'')}"
=> "__node_regexp__async"

One simple fix is to specify "async" as a string and not a regex:

node /(?<!a)sync/ {
  ...
}
node async {
  ...
}

Nirupama Mantha (Jira)

unread,
Apr 26, 2022, 4:55:01 PM4/26/22
to puppe...@googlegroups.com

chouser we'll accept a PR if you want to work on this, we currently don't have plans to address this.

Alvin Rodis (Jira)

unread,
Dec 7, 2022, 8:50:02 PM12/7/22
to puppe...@googlegroups.com
Alvin Rodis updated an issue
 
Change By: Alvin Rodis
Zendesk Ticket Count: 1
Zendesk Ticket IDs: 50332
This message was sent by Atlassian Jira (v8.20.11#820011-sha1:0629dd8)
Atlassian logo

Alvin Rodis (Jira)

unread,
Dec 7, 2022, 8:50:03 PM12/7/22
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages