diff options
| author | Casey Dahlin <cdahlin@redhat.com> | 2008-10-09 14:10:26 -0400 |
|---|---|---|
| committer | Casey Dahlin <cdahlin@redhat.com> | 2008-10-09 14:10:26 -0400 |
| commit | 3c1888a4ca9fc64063553ccb5fbf0951a8ae8c32 (patch) | |
| tree | 4f11e7e60070452e9c20b07b1455806fe394c969 | |
| parent | 45c7cf611b96ee7b5aa85bb18feafe29f270c7e0 (diff) | |
Delete trace function
Its not a very good solution anyway, so we'll just pop it out.
| -rw-r--r-- | state.rb | 19 |
1 files changed, 2 insertions, 17 deletions
@@ -27,11 +27,6 @@ class AmbiguousRequest < StandardError; end ENABLE_TRACE = false -def trace(*args) - return unless ENABLE_TRACE - $stderr.puts *args -end - =begin rdoc An instance of State exists whenever a state can become true without having to toggle any other states, or whenever a state _is_ true. @@ -83,12 +78,10 @@ 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| dep = dep.state next if dep.status != :down raise ConsistencyFault, "Lost dep on #{dep} without notify for #{self}" if @status != :down - trace " Purging..." @@states.delete self #self.methods.each{ |x| define_method(x, :"*args"){ raise ConsistencyFault, "Operation on dead state" } } self.freeze @@ -131,7 +124,6 @@ class State if @status == :down and self.class.hold_provides.size > 0 return self.fork(hold) end - trace "#{self} being held with #{hold}" @holds.add hold rise if @status == :down self @@ -164,7 +156,6 @@ class State hold = Hold::User.new(params) if hold == :user hold = Hold::System.new(params) if hold == :system raise TypeError unless hold.is_a? Hold - trace "#{self} being released from #{hold}" @holds.delete hold drop if @holds.size == 0 self @@ -185,12 +176,7 @@ class State return unless @status == :up @status = :dropping break_holds if @holds.size > 0 - if drop - trace "Dropping #{self}" - self.class.falling_edge.call(params) - else - trace "#{self} becomes defunct" - end + self.class.falling_edge.call(params) if drop @deps.each{ |x| x.state.release(self) } @hold_params = {} @status = :down @@ -311,7 +297,6 @@ private # Set this state to true def rise return if @status == :up - trace "Raising #{self}" @status = :rising @deps.each{ |x| x.state.hold(self) } self.class.rising_edge.call(params) @@ -321,7 +306,7 @@ private # Inform other states that they may no longer depend on this one def break_holds - @holds.each{ |x| trace "breaking #{x} on #{self}"; x.clear } + @holds.each{ |x| x.clear } @holds = Set.new end end |
