diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-09-23 20:22:44 +0200 |
---|---|---|
committer | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-09-23 20:22:44 +0200 |
commit | bfba2cdf8787f1e7fa778bba1b74c03fc06634cd (patch) | |
tree | 425a262318df622d213a29730df5d887da722496 /lib/puppet/parser/ast/leaf.rb | |
parent | db67e5fd4e2241f59341c38c5a1e291e68aec523 (diff) | |
download | puppet-bfba2cdf8787f1e7fa778bba1b74c03fc06634cd.tar.gz puppet-bfba2cdf8787f1e7fa778bba1b74c03fc06634cd.tar.xz puppet-bfba2cdf8787f1e7fa778bba1b74c03fc06634cd.zip |
Fix #2672 - Make sure nodenames keep their underscores when used as classname
The #2627 fix was modifying nodename in case of string nodename, but
was removing '_'. Since underscores is a valid character in a class
name, we now allow it.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/parser/ast/leaf.rb')
-rw-r--r-- | lib/puppet/parser/ast/leaf.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/leaf.rb b/lib/puppet/parser/ast/leaf.rb index 2f00ea78d..153120a34 100644 --- a/lib/puppet/parser/ast/leaf.rb +++ b/lib/puppet/parser/ast/leaf.rb @@ -102,7 +102,7 @@ class Puppet::Parser::AST end def to_classname - to_s.downcase.gsub(/[^-a-zA-Z0-9:.]/,'').sub(/^\.+/,'') + to_s.downcase.gsub(/[^-\w:.]/,'').sub(/^\.+/,'') end # implementing eql? and hash so that when an HostName is stored |