diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-06 04:02:41 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-06 04:02:41 +0000 |
| commit | 73c5c585c06fb1058f23d37c04cb2648d2e85c2b (patch) | |
| tree | 9039d33c01c5bf21123fda69cc5f6d83fbf36751 /lib | |
| parent | 95f273eb416d0544161cb2a5aca677e2f2239b37 (diff) | |
| download | puppet-73c5c585c06fb1058f23d37c04cb2648d2e85c2b.tar.gz puppet-73c5c585c06fb1058f23d37c04cb2648d2e85c2b.tar.xz puppet-73c5c585c06fb1058f23d37c04cb2648d2e85c2b.zip | |
removing one of the stack traces from error output
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1235 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/puppet/statechange.rb | 80 |
1 files changed, 29 insertions, 51 deletions
diff --git a/lib/puppet/statechange.rb b/lib/puppet/statechange.rb index c18cdd25c..3d1783746 100644 --- a/lib/puppet/statechange.rb +++ b/lib/puppet/statechange.rb @@ -41,64 +41,42 @@ module Puppet #@state.info "Is: %s, Should: %s" % # [@state.is.inspect, @state.should.inspect] - begin - events = @state.sync - if events.nil? - return nil - end + # The transaction catches any exceptions here. + events = @state.sync + if events.nil? + return nil + end - if events.is_a?(Array) - if events.empty? - return nil - end - else - events = [events] + if events.is_a?(Array) + if events.empty? + return nil end - - return events.collect { |event| - # default to a simple event type - if ! event.is_a?(Symbol) - @state.warning("State '%s' returned invalid event '%s'; resetting to default" % - [@state.class,event]) - - event = @state.parent.class.name.id2name + "_changed" - end - - # i should maybe include object type, but the event type - # should basically point to that, right? - #:state => @state, - #:object => @state.parent, - @state.log @state.change_to_s - Puppet::Event.new( - :event => event, - :change => self, - :transaction => @transaction, - :source => @state.parent, - :message => self.to_s - ) - } - rescue => detail - #@state.err "%s failed: %s" % [self.to_s,detail] - if Puppet[:debug] - puts detail.backtrace + else + events = [events] + end + + return events.collect { |event| + # default to a simple event type + if ! event.is_a?(Symbol) + @state.warning("State '%s' returned invalid event '%s'; resetting to default" % + [@state.class,event]) + + event = @state.parent.class.name.id2name + "_changed" end - raise - # there should be a way to ask the state what type of event - # it would have generated, but... - pname = @state.parent.class.name.id2name - #if pname.is_a?(Symbol) - # pname = pname.id2name - #end + + # i should maybe include object type, but the event type + # should basically point to that, right? #:state => @state, - @state.log "Failed: " + @state.change_to_s - return Puppet::Event.new( - :event => pname + "_failed", + #:object => @state.parent, + @state.log @state.change_to_s + Puppet::Event.new( + :event => event, :change => self, - :source => @state.parent, :transaction => @transaction, - :message => "Failed: " + self.to_s + :source => @state.parent, + :message => self.to_s ) - end + } end def forward |
