Please review pull request #176: Revert "Include failed command output in exceptions" opened by (pcarlisle)

Description:

This reverts commit 6480074. It broke the
testing harness.

  • Opened: Thu Mar 22 15:59:29 UTC 2012
  • Based on: puppetlabs:master (a01e8b8f426d5bd32f3b0ec9c991703bd8df917a)
  • Requested merge: pcarlisle:revert_report_error (2de1a6598526d0af01c02d8083fd87dc7d1c3e7a)

Diff follows:

diff --git a/lib/command.rb b/lib/command.rb
index bff0473..26b3302 100644
--- a/lib/command.rb
+++ b/lib/command.rb
@@ -21,10 +21,12 @@ def exec(host, options={})
     result = host.exec(cmdline, options)
 
     result.log
-    unless options[:acceptable_exit_codes].include?(result.exit_code)
-      limit = 10
-      formatted_output = result.output.split("\n").last(limit).collect {|x| "\t" + x}.join("\n")
-      raise "Host '#{host}' exited with #{result.exit_code} running:\n #{cmdline}\nLast #{limit} lines of output were:\n#{formatted_output}"
+    if options[:acceptable_exit_codes].include?(result.exit_code)
+      # cool.
+    elsif options[:failing_exit_codes].include?(result.exit_code)
+      assert( false, "Host '#{host} exited with #{result.exit_code} running: #{cmdline}" )
+    else
+      raise "Host '#{host}' exited with #{result.exit_code} running: #{cmdline}"
     end
 
     result

    

--
You received this message because you are subscribed to the Google Groups "Puppet Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to