diff options
author | Casey Dahlin <cdahlin@redhat.com> | 2008-10-07 10:49:50 -0400 |
---|---|---|
committer | Casey Dahlin <cdahlin@redhat.com> | 2008-10-07 10:49:50 -0400 |
commit | 7817ba3ef0c29be88893bacfb863f48b097e031a (patch) | |
tree | 731b32fca6d4e3a7cd0c08387f5b1c45e1a989cf /state.rb | |
parent | 3c54eacbd4a6866e86fd80e60426812c18c59824 (diff) | |
download | upstate-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.rb | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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 |