summaryrefslogtreecommitdiffstats
path: root/lib/puppet/parser/compile.rb
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-02-11 12:37:00 -0800
committerLuke Kanies <luke@madstop.com>2008-02-11 12:37:00 -0800
commit194e7309c9c481f7e67bd63b13e2fc80fe0a4f00 (patch)
treeab8770529eefca43abf6145858addd1e65f71f5c /lib/puppet/parser/compile.rb
parentfb4bdc0b02bba1291cb78ccd5c2a3198d3929d69 (diff)
downloadpuppet-194e7309c9c481f7e67bd63b13e2fc80fe0a4f00.tar.gz
puppet-194e7309c9c481f7e67bd63b13e2fc80fe0a4f00.tar.xz
puppet-194e7309c9c481f7e67bd63b13e2fc80fe0a4f00.zip
Moving all of the tests for Puppet::Parser::Compile to
rspec, so I can refactor the class to more heavily rely on a Node::Catalog instead of doing its own resource container management.
Diffstat (limited to 'lib/puppet/parser/compile.rb')
-rw-r--r--lib/puppet/parser/compile.rb21
1 files changed, 16 insertions, 5 deletions
diff --git a/lib/puppet/parser/compile.rb b/lib/puppet/parser/compile.rb
index e1e230d48..42d229867 100644
--- a/lib/puppet/parser/compile.rb
+++ b/lib/puppet/parser/compile.rb
@@ -68,10 +68,10 @@ class Puppet::Parser::Compile
evaluate_generators()
- fail_on_unevaluated()
-
finish()
+ fail_on_unevaluated()
+
if Puppet[:storeconfigs]
store()
end
@@ -200,8 +200,6 @@ class Puppet::Parser::Compile
# Store a resource override.
def store_override(override)
- override.override = true
-
# If possible, merge the override in immediately.
if resource = @resource_table[override.ref]
resource.merge(override)
@@ -383,7 +381,20 @@ class Puppet::Parser::Compile
# Make sure all of our resources and such have done any last work
# necessary.
def finish
- @resource_table.each { |name, resource| resource.finish if resource.respond_to?(:finish) }
+ @resource_table.each do |name, resource|
+ # Add in any resource overrides.
+ if overrides = resource_overrides(resource)
+ overrides.each do |over|
+ resource.merge(over)
+ end
+
+ # Remove the overrides, so that the configuration knows there
+ # are none left.
+ overrides.clear
+ end
+
+ resource.finish if resource.respond_to?(:finish)
+ end
end
# Initialize the top-level scope, class, and resource.