summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/resource
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-11-25 22:20:39 -0600
committerJames Turnbull <james@lovedthanlost.net>2008-11-26 16:09:47 +1100
commit3421954444f4c06d6e7b80430f89fccf56343fe2 (patch)
treeed5d90a44a78ba25c242d5217bd795653fbec04c /lib/puppet/parser/resource
parenta1ac9a5c14d4589f5ee7fdaab3b2c47180c66a2e (diff)
downloadpuppet-3421954444f4c06d6e7b80430f89fccf56343fe2.tar.gz
puppet-3421954444f4c06d6e7b80430f89fccf56343fe2.tar.xz
puppet-3421954444f4c06d6e7b80430f89fccf56343fe2.zip
Fixing #1755 - handling fully qualified classes correctly.
This involves lexing '::class' tokens along with correctly looking them up from the Resource::Reference class. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/parser/resource')
-rw-r--r--lib/puppet/parser/resource/reference.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/puppet/parser/resource/reference.rb b/lib/puppet/parser/resource/reference.rb
index c59748049..cb505d606 100644
--- a/lib/puppet/parser/resource/reference.rb
+++ b/lib/puppet/parser/resource/reference.rb
@@ -37,7 +37,7 @@ class Puppet::Parser::Resource::Reference < Puppet::ResourceReference
if self.title == :main
tmp = @scope.findclass("")
else
- unless tmp = @scope.findclass(self.title)
+ unless tmp = @scope.parser.classes[self.title]
fail Puppet::ParseError, "Could not find class '%s'" % self.title
end
end
@@ -46,8 +46,9 @@ class Puppet::Parser::Resource::Reference < Puppet::ResourceReference
fail Puppet::ParseError, "Could not find node '%s'" % self.title
end
else # normal definitions
- # We have to swap these variables around so the errors are right.
- tmp = @scope.finddefine(self.type)
+ # The resource type is capitalized, so we have to downcase. Really,
+ # we should have a better interface for finding these, but eh.
+ tmp = @scope.parser.definitions[self.type.downcase]
end
if tmp