[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:31:19 UTC 2010


The following commit has been merged in the upstream branch:
commit 010907b816699b8b0d7419bec31a5f4e253d7510
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Mon Apr 5 18:21:09 2010 -0700

    Mark resource/status as failed if they are associated with a failing
    event.
    
    This restores behavior for resource dependencies that was broken
    in the #2759 series.

diff --git a/lib/puppet/resource/status.rb b/lib/puppet/resource/status.rb
index ab088fb..87c6161 100644
--- a/lib/puppet/resource/status.rb
+++ b/lib/puppet/resource/status.rb
@@ -24,6 +24,9 @@ class Puppet::Resource::Status
 
     def add_event(event)
         @events << event
+        if event.status == 'failure'
+            self.failed = true
+        end
     end
 
     def events
diff --git a/spec/unit/transaction/resource_harness.rb b/spec/unit/transaction/resource_harness.rb
index f69b560..2abec3c 100755
--- a/spec/unit/transaction/resource_harness.rb
+++ b/spec/unit/transaction/resource_harness.rb
@@ -204,14 +204,14 @@ describe Puppet::Transaction::ResourceHarness do
 
     describe "when applying changes" do
         before do
-            @change1 = stub 'change1', :apply => stub("event")
-            @change2 = stub 'change2', :apply => stub("event")
+            @change1 = stub 'change1', :apply => stub("event", :status => "success")
+            @change2 = stub 'change2', :apply => stub("event", :status => "success")
             @changes = [@change1, @change2]
         end
 
         it "should apply the change" do
-            @change1.expects(:apply)
-            @change2.expects(:apply)
+            @change1.expects(:apply).returns( stub("event", :status => "success") )
+            @change2.expects(:apply).returns( stub("event", :status => "success") )
 
             @harness.apply_changes(@status, @changes)
         end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list