diff options
author | Casey Dahlin <cdahlin@redhat.com> | 2008-10-10 16:30:14 -0400 |
---|---|---|
committer | Casey Dahlin <cdahlin@redhat.com> | 2008-10-10 16:30:14 -0400 |
commit | eab22be32d53d8a82571a48124f78c745299ae9c (patch) | |
tree | 30248842d41e01cf63816fa0ba96b18ff5506390 /state.rb | |
parent | 8b070c38e555df5c98e7d6648672dbe5806c7085 (diff) | |
download | upstate-eab22be32d53d8a82571a48124f78c745299ae9c.tar.gz upstate-eab22be32d53d8a82571a48124f78c745299ae9c.tar.xz upstate-eab22be32d53d8a82571a48124f78c745299ae9c.zip |
Make State#check_deps behave properly when dropping
State#check_deps used to throw an exception if called for a dropping receiver.
Now check_deps is a no-op on dropping states.
Diffstat (limited to 'state.rb')
-rw-r--r-- | state.rb | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -78,10 +78,13 @@ class State # Make sure our deps are satisfied, and remove ourselves from the list of # states if they aren't def check_deps + return if @status == :dropping @deps.each do |dep| dep = dep.state next if dep.status != :down - raise ConsistencyFault, "Lost dep on #{dep} without notify for #{self}" if @status != :down + unless @status == :down + raise ConsistencyFault, "Lost dep on #{dep} without notify for #{self}" + end @@states.delete self #self.methods.each{ |x| define_method(x, :"*args"){ raise ConsistencyFault, "Operation on dead state" } } self.freeze |