diff options
author | Luke Kanies <luke@madstop.com> | 2008-02-12 14:19:19 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2008-02-12 14:19:19 -0600 |
commit | c8da318a2a4445e0ce10c76a7fbb64635b291ccd (patch) | |
tree | 3e9f1495f1779f18a8282f9a62a4c4ad97ecd6e4 /lib/puppet/parser/compiler.rb | |
parent | 8b2fae019b31513becd002eb474e1b4803abde24 (diff) | |
download | puppet-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/compiler.rb')
-rw-r--r-- | lib/puppet/parser/compiler.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb index 26fdd3743..68c06e500 100644 --- a/lib/puppet/parser/compiler.rb +++ b/lib/puppet/parser/compiler.rb @@ -31,6 +31,7 @@ class Puppet::Parser::Compiler # Store a resource in our resource table. def add_resource(scope, resource) + # Note that this will fail if the resource is not unique. @catalog.add_resource(resource) # And in the resource graph. At some point, this might supercede @@ -48,10 +49,10 @@ class Puppet::Parser::Compiler # the scope in which it was evaluated, so that we can look it up later. def class_set(name, scope) if existing = @class_scopes[name] - if existing.nodescope? or scope.nodescope? + if existing.nodescope? != scope.nodescope? raise Puppet::ParseError, "Cannot have classes, nodes, or definitions with the same name" else - raise Puppet::DevError, "Somehow evaluated the same class twice" + raise Puppet::DevError, "Somehow evaluated %s %s twice" % [ existing.nodescope? ? "node" : "class", name] end end @class_scopes[name] = scope |