Permalink
Browse files

fixed output for failure status

  • Loading branch information...
1 parent 682f3df commit 025c1aedfff655e5fa02131053ffeaf730ac7428 John Goulah committed Feb 22, 2012
Showing with 12 additions and 7 deletions.
  1. +3 −1 README.md
  2. +8 −5 lib/chef/knife/lastrun.rb
  3. +1 −1 lib/knife-lastrun/version.rb
View
@@ -35,5 +35,7 @@ in /etc/chef/client.rb
```
require "lastrun_update"
-report_handlers << LastRunUpdateHandler.new
+handler = LastRunUpdateHandler.new
+report_handlers << handler
+exception_handlers << handler
```
View
@@ -51,11 +51,14 @@ def run
ui.msg "\n"
# debug stuff
- debug_entries = header('Backtrace', 'Exception', 'Formatted Exception');
- [:backtrace, :exception, :formatted_exception].each do |msg|
- debug_entries << (node[:lastrun][:debug][msg] ? node[:lastrun][:debug][msg].to_s : "none")
- end
- ui.msg h.list(debug_entries, :columns_down, 2)
+ debug_entries = []
+ debug_entries << h.color('Backtrace', :bold)
+ debug_entries << (node[:lastrun][:debug][:backtrace] ? node[:lastrun][:debug][:backtrace].join("\n") : "none")
+ debug_entries << ""
+
+ debug_entries << h.color('Exception', :bold)
+ debug_entries << (node[:lastrun][:debug][:formatted_exception] ? node[:lastrun][:debug][:formatted_exception].strip : "none")
+ ui.msg h.list(debug_entries, :rows)
ui.msg "\n"
end
@@ -1,5 +1,5 @@
module Knife
module NodeLastrun
- VERSION = "0.0.1"
+ VERSION = "0.0.2"
end
end

0 comments on commit 025c1ae

Please sign in to comment.