summaryrefslogtreecommitdiffstats
path: root/state.rb
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-10-07 10:49:50 -0400
committerCasey Dahlin <cdahlin@redhat.com>2008-10-07 10:49:50 -0400
commit7817ba3ef0c29be88893bacfb863f48b097e031a (patch)
tree731b32fca6d4e3a7cd0c08387f5b1c45e1a989cf /state.rb
parent3c54eacbd4a6866e86fd80e60426812c18c59824 (diff)
downloadupstate-7817ba3ef0c29be88893bacfb863f48b097e031a.tar.gz
upstate-7817ba3ef0c29be88893bacfb863f48b097e031a.tar.xz
upstate-7817ba3ef0c29be88893bacfb863f48b097e031a.zip
Fix some behaviors of State#check_deps
State#check_deps now returns as soon as it has found a missing dep. The raised ConsistencyFault now has a message, and the self-stripping of methods that dead states perform no longer throws exceptions.
Diffstat (limited to 'state.rb')
-rw-r--r--state.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/state.rb b/state.rb
index 6f232c9..ea3ace5 100644
--- a/state.rb
+++ b/state.rb
@@ -76,12 +76,15 @@ class State
# Make sure our deps are satisfied, and remove ourselves from the list of
# states if they aren't
def check_deps
+ trace "Dep check on #{self}"
@deps.each do |dep|
next if dep.active
- raise ConsistencyFault if self.active
+ raise ConsistencyFault, "Lost dep on #{dep} without notify for #{self}" if self.active
+ trace " Purging..."
@@states.delete self
- self.methods.each{ |x| undef x }
+ self.methods.each{ |x| undef x rescue nil }
self.freeze
+ return
end
end