summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/chef/knife/ssh.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index 4569cc097e..db0fb7dd41 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -103,6 +103,13 @@ class Chef
:boolean => true,
:default => true
+ option :on_error,
+ :short => '-e',
+ :long => '--exit-on-error',
+ :description => "Immediately exit if an error is encountered",
+ :boolean => true,
+ :proc => Proc.new { :raise }
+
def session
config[:on_error] ||= :skip
ssh_error_handler = Proc.new do |server|