summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/ast/definition.rb
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2009-07-28 19:37:11 +0200
committerJames Turnbull <james@lovedthanlost.net>2009-08-01 11:15:29 +1000
commitb45ccf8d38a10d3f5226cbabe494240901e4e383 (patch)
tree9e5e8bbbd88ce7f66dc5a42c6aa7c2c6c57e7b4e /lib/puppet/parser/ast/definition.rb
parent58a73b5c68485dc5d41a46936c31e5fad5f037b5 (diff)
downloadpuppet-b45ccf8d38a10d3f5226cbabe494240901e4e383.tar.gz
puppet-b45ccf8d38a10d3f5226cbabe494240901e4e383.tar.xz
puppet-b45ccf8d38a10d3f5226cbabe494240901e4e383.zip
Implement node matching with regexes
This patch enhance AST::HostName to support regexes, and modifies the parser to allow regex to be used as node name. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>]
Diffstat (limited to 'lib/puppet/parser/ast/definition.rb')
-rw-r--r--lib/puppet/parser/ast/definition.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/puppet/parser/ast/definition.rb b/lib/puppet/parser/ast/definition.rb
index 092afef46..00b0416a0 100644
--- a/lib/puppet/parser/ast/definition.rb
+++ b/lib/puppet/parser/ast/definition.rb
@@ -24,9 +24,13 @@ class Puppet::Parser::AST::Definition < Puppet::Parser::AST::Branch
false
end
+ def get_classname(scope)
+ self.classname
+ end
+
# Create a resource that knows how to evaluate our actual code.
def evaluate(scope)
- resource = Puppet::Parser::Resource.new(:type => self.class.name, :title => self.classname, :scope => scope, :source => scope.source)
+ resource = Puppet::Parser::Resource.new(:type => self.class.name, :title => get_classname(scope), :scope => scope, :source => scope.source)
scope.catalog.tag(*resource.tags)