summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/resource/reference.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-12 17:37:51 -0600
committerLuke Kanies <luke@madstop.com>2008-02-12 17:37:51 -0600
commitda78d96cb139db0775e634b2fa4bd9c173752127 (patch)
tree4139d3a2011baedb171a8307c4830c5ac3fe3625 /lib/puppet/parser/resource/reference.rb
parentbee9aba2da453151a80c6e1f25f16bec3bfde8d2 (diff)
parent3af6827875f4e02b47fe2293280ff9afe811485f (diff)
downloadpuppet-da78d96cb139db0775e634b2fa4bd9c173752127.tar.gz
puppet-da78d96cb139db0775e634b2fa4bd9c173752127.tar.xz
puppet-da78d96cb139db0775e634b2fa4bd9c173752127.zip
Merge branch '0.24.x'
Conflicts: CHANGELOG
Diffstat (limited to 'lib/puppet/parser/resource/reference.rb')
-rw-r--r--lib/puppet/parser/resource/reference.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/puppet/parser/resource/reference.rb b/lib/puppet/parser/resource/reference.rb
index 6e70d23b7..c59748049 100644
--- a/lib/puppet/parser/resource/reference.rb
+++ b/lib/puppet/parser/resource/reference.rb
@@ -37,10 +37,14 @@ class Puppet::Parser::Resource::Reference < Puppet::ResourceReference
if self.title == :main
tmp = @scope.findclass("")
else
- tmp = @scope.findclass(self.title)
+ unless tmp = @scope.findclass(self.title)
+ fail Puppet::ParseError, "Could not find class '%s'" % self.title
+ end
end
when "Node": # look for node definitions
- tmp = @scope.parser.nodes[self.title]
+ unless tmp = @scope.parser.nodes[self.title]
+ 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)
@@ -49,7 +53,7 @@ class Puppet::Parser::Resource::Reference < Puppet::ResourceReference
if tmp
@definedtype = tmp
else
- fail Puppet::ParseError, "Could not find resource '%s'" % self
+ fail Puppet::ParseError, "Could not find resource type '%s'" % self.type
end
end