summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-28 15:55:39 -0600
committerLuke Kanies <luke@madstop.com>2008-02-28 15:55:39 -0600
commitabd688ea1a0ebd555eac20185d82cc6430507edf (patch)
tree6704feb11868a5b8ae7fcfb311f3705969fb4345
parent29aafb4e98b8751a11787be33b2dfcf910a84fa3 (diff)
downloadpuppet-abd688ea1a0ebd555eac20185d82cc6430507edf.tar.gz
puppet-abd688ea1a0ebd555eac20185d82cc6430507edf.tar.xz
puppet-abd688ea1a0ebd555eac20185d82cc6430507edf.zip
Fixing #1092 by no longer using the resource reference to
look resources up, which means there's no concern about not finding the resource, which is where the nil was coming from. We now just iterate over the vertices.
-rw-r--r--lib/puppet/parser/compiler.rb5
-rwxr-xr-xspec/unit/parser/compiler.rb4
2 files changed, 4 insertions, 5 deletions
diff --git a/lib/puppet/parser/compiler.rb b/lib/puppet/parser/compiler.rb
index 132ec15db..70cd6e11a 100644
--- a/lib/puppet/parser/compiler.rb
+++ b/lib/puppet/parser/compiler.rb
@@ -366,9 +366,8 @@ class Puppet::Parser::Compiler
# Make sure all of our resources and such have done any last work
# necessary.
def finish
- @catalog.resources.each do |name|
- resource = @catalog.resource(name)
-
+ #@catalog.resources.each do |name|
+ @catalog.vertices.each do |resource|
# Add in any resource overrides.
if overrides = resource_overrides(resource)
overrides.each do |over|
diff --git a/spec/unit/parser/compiler.rb b/spec/unit/parser/compiler.rb
index 9980f2c6a..ab430da62 100755
--- a/spec/unit/parser/compiler.rb
+++ b/spec/unit/parser/compiler.rb
@@ -7,7 +7,7 @@ describe Puppet::Parser::Compiler do
@node = Puppet::Node.new "testnode"
@parser = Puppet::Parser::Parser.new :environment => "development"
- @scope_resource = stub 'scope_resource', :builtin? => true
+ @scope_resource = stub 'scope_resource', :builtin? => true, :finish => nil, :ref => 'Class[main]'
@scope = stub 'scope', :resource => @scope_resource, :source => mock("source")
@compiler = Puppet::Parser::Compiler.new(@node, @parser)
end
@@ -529,4 +529,4 @@ describe Puppet::Parser::Compiler do
lambda { @compiler.class_set("one", @node) }.should raise_error(Puppet::ParseError)
end
end
-end \ No newline at end of file
+end