Issue #11133 has been updated by Neil Hemingway.

[patch](https://github.com/nhemingway/puppet/commit/d1712e964d601602e5819298658afb3684a65e8c).

Note: No tests because (as the commit makes clear) I'm uncertain whether this 
is the best place for the fix.  I need a better understanding of the 
architecture of puppet.
----------------------------------------
Bug #11133: Regex captures don't work in node definitions
https://projects.puppetlabs.com/issues/11133

Author: Neil Hemingway
Status: Unreviewed
Priority: Normal
Assignee: Neil Hemingway
Category: node
Target version: 2.7.x
Affected Puppet version: 2.7.1
Keywords: node regex capture
Branch: 


With the following manifest:

node /^ws-([[:digit:]]+)/ {
  $hostid = $2
  notice("site.pp: Hostid: $hostid")

  # Same regex as above
  if $hostname =~ /^ws-([[:digit:]]+)/ {
    notice("\$2: $2")
  }
}


When run against a machine ws-01, I get out:

puppet-master[29847]: (Scope(Node[ws-:digit:])) site.pp: Hostid: 
puppet-master[29847]: (Scope(Node[ws-:digit:])) $2: 01


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to