summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-09-06 20:00:24 -0500
committerLuke Kanies <luke@madstop.com>2007-09-06 20:00:24 -0500
commit4212f9c2250377793d6ed636c18c7a8538160366 (patch)
treef43b0754ada52c7e1ab41f6be0a7f820b6b05c90 /lib/puppet/parser
parent4104bd3ee9fa146b49aa446fbf4cc3edcdf0974d (diff)
downloadpuppet-4212f9c2250377793d6ed636c18c7a8538160366.tar.gz
puppet-4212f9c2250377793d6ed636c18c7a8538160366.tar.xz
puppet-4212f9c2250377793d6ed636c18c7a8538160366.zip
Fixing #802 -- tags are now applied before parent classes are evaluated, so parent classes can use tagged() to test if a node is a member of a subclass.
Diffstat (limited to 'lib/puppet/parser')
-rw-r--r--lib/puppet/parser/ast/hostclass.rb4
-rw-r--r--lib/puppet/parser/functions.rb5
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/puppet/parser/ast/hostclass.rb b/lib/puppet/parser/ast/hostclass.rb
index 0a8e33970..9c039bb49 100644
--- a/lib/puppet/parser/ast/hostclass.rb
+++ b/lib/puppet/parser/ast/hostclass.rb
@@ -30,6 +30,8 @@ class Puppet::Parser::AST
return nil
end
+ scope.compile.configuration.tag(self.classname)
+
pnames = nil
if pklass = self.parentobj
pklass.safeevaluate :scope => scope, :resource => options[:resource]
@@ -71,7 +73,7 @@ class Puppet::Parser::AST
if s = scope.compile.class_scope(klass)
return s
else
- raise Puppet::DevError, "Could not find scope for %s" % klass.fqname
+ raise Puppet::DevError, "Could not find scope for %s" % klass.classname
end
end
end
diff --git a/lib/puppet/parser/functions.rb b/lib/puppet/parser/functions.rb
index 4c747af84..7ffdb6ccb 100644
--- a/lib/puppet/parser/functions.rb
+++ b/lib/puppet/parser/functions.rb
@@ -144,11 +144,12 @@ module Functions
tells you whether the current container is tagged with the specified tags.
The tags are ANDed, so that all of the specified tags must be included for
the function to return true.") do |vals|
- classlist = compile.classlist
+ configtags = compile.configuration.tags
+ resourcetags = resource.tags
retval = true
vals.each do |val|
- unless classlist.include?(val) or self.resource.tags.include?(val)
+ unless configtags.include?(val) or resourcetags.include?(val)
retval = false
break
end