diff options
author | Brice Figureau <brice-puppet@daysofwonder.com> | 2009-07-28 19:42:24 +0200 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-08-01 11:15:29 +1000 |
commit | 58a73b5c68485dc5d41a46936c31e5fad5f037b5 (patch) | |
tree | d8fa2e0b6429a1a1262bc19ad6d876b565500b42 /lib/puppet/parser/parser_support.rb | |
parent | 3ebf148bf3d82d25e690aec6ec49975e0837e604 (diff) | |
download | puppet-58a73b5c68485dc5d41a46936c31e5fad5f037b5.tar.gz puppet-58a73b5c68485dc5d41a46936c31e5fad5f037b5.tar.xz puppet-58a73b5c68485dc5d41a46936c31e5fad5f037b5.zip |
Make sure node are referenced by their names
This patch uses the unused AST::HostName as the only way to reference
a node in the AST nodes array.
The AST::HostName respect the hash properties of the underlying
string, to keep the O(1) hash properties.
Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'lib/puppet/parser/parser_support.rb')
-rw-r--r-- | lib/puppet/parser/parser_support.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/puppet/parser/parser_support.rb b/lib/puppet/parser/parser_support.rb index e1af2fe82..b13fbb47f 100644 --- a/lib/puppet/parser/parser_support.rb +++ b/lib/puppet/parser/parser_support.rb @@ -354,7 +354,7 @@ class Puppet::Parser::Parser names = [names] unless names.instance_of?(Array) doc = lexer.getcomment names.collect do |name| - name = name.to_s.downcase + name = AST::HostName.new :value => name unless name.is_a?(AST::HostName) if other = @loaded_code.node(name) error("Node %s is already defined at %s:%s; cannot redefine" % [other.name, other.file, other.line]) end @@ -372,7 +372,7 @@ class Puppet::Parser::Parser args[:parentclass] = options[:parent] end node = ast(AST::Node, args) - node.classname = name + node.classname = name.to_classname @loaded_code.add_node(name, node) node end |