summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/resource
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-12 14:19:19 -0600
committerLuke Kanies <luke@madstop.com>2008-02-12 14:19:19 -0600
commitc8da318a2a4445e0ce10c76a7fbb64635b291ccd (patch)
tree3e9f1495f1779f18a8282f9a62a4c4ad97ecd6e4 /lib/puppet/parser/resource
parent8b2fae019b31513becd002eb474e1b4803abde24 (diff)
downloadpuppet-c8da318a2a4445e0ce10c76a7fbb64635b291ccd.tar.gz
puppet-c8da318a2a4445e0ce10c76a7fbb64635b291ccd.tar.xz
puppet-c8da318a2a4445e0ce10c76a7fbb64635b291ccd.zip
Moving the ast node tests to rspec (which I could have
*sworn* I did this weekend). In the process, I fixed a couple of bugs related to differentiating between nodes and classes, and then cleaned up quite a few error messages.
Diffstat (limited to 'lib/puppet/parser/resource')
-rw-r--r--lib/puppet/parser/resource/reference.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/puppet/parser/resource/reference.rb b/lib/puppet/parser/resource/reference.rb
index ea53b421a..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)