Just cleaning up the code a bit before a modification.

Signed-off-by: Luke Kanies <[email protected]>
---
 lib/puppet/transaction.rb |   82 ++++++++++++++++++++++++--------------------
 1 files changed, 45 insertions(+), 37 deletions(-)

diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index 54163c5..80e0d49 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -202,43 +202,7 @@ class Transaction
         if checkskip and skip?(resource)
             @resourcemetrics[:skipped] += 1
         else
-            @resourcemetrics[:scheduled] += 1
-            
-            changecount = @changes.length
-            
-            # We need to generate first regardless, because the recursive
-            # actions sometimes change how the top resource is applied.
-            children = eval_generate(resource)
-            
-            if children and resource.depthfirst?
-                children.each do |child|
-                    # The child will never be skipped when the parent isn't
-                    events += eval_resource(child, false)
-                end
-            end
-
-            # Perform the actual changes
-            seconds = thinmark do
-                events += apply(resource)
-            end
-
-            if children and ! resource.depthfirst?
-                children.each do |child|
-                    events += eval_resource(child, false)
-                end
-            end
-
-            # A bit of hackery here -- if skipcheck is true, then we're the
-            # top-level resource.  If that's the case, then make sure all of
-            # the changes list this resource as a proxy.  This is really only
-            # necessary for rollback, since we know the generating resource
-            # during forward changes.
-            if children and checkskip
-                @changes[changecount..-1].each { |change| change.proxy = 
resource }
-            end
-
-            # Keep track of how long we spend in each type of resource
-            @timemetrics[resource.class.name] += seconds
+            events += eval_children_and_apply_resource(resource, checkskip)
         end
 
         # Check to see if there are any events for this resource
@@ -262,6 +226,50 @@ class Transaction
         events
     end
 
+    def eval_children_and_apply_resource(resource, checkskip)
+        events = []
+
+        @resourcemetrics[:scheduled] += 1
+        
+        changecount = @changes.length
+        
+        # We need to generate first regardless, because the recursive
+        # actions sometimes change how the top resource is applied.
+        children = eval_generate(resource)
+        
+        if children and resource.depthfirst?
+            children.each do |child|
+                # The child will never be skipped when the parent isn't
+                events += eval_resource(child, false)
+            end
+        end
+
+        # Perform the actual changes
+        seconds = thinmark do
+            events += apply(resource)
+        end
+
+        if children and ! resource.depthfirst?
+            children.each do |child|
+                events += eval_resource(child, false)
+            end
+        end
+
+        # A bit of hackery here -- if skipcheck is true, then we're the
+        # top-level resource.  If that's the case, then make sure all of
+        # the changes list this resource as a proxy.  This is really only
+        # necessary for rollback, since we know the generating resource
+        # during forward changes.
+        if children and checkskip
+            @changes[changecount..-1].each { |change| change.proxy = resource }
+        end
+
+        # Keep track of how long we spend in each type of resource
+        @timemetrics[resource.class.name] += seconds
+
+        events
+    end
+
     # This method does all the actual work of running a transaction.  It
     # collects all of the changes, executes them, and responds to any
     # necessary events.
-- 
1.6.1


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to