summaryrefslogtreecommitdiff
path: root/lib/chef
diff options
context:
space:
mode:
authorRyan Cragun <me@ryan.ec>2015-02-18 17:58:28 -0800
committerRyan Cragun <me@ryan.ec>2015-03-03 10:40:32 -0800
commit9971affd88292c4da8afaf2c2b06571757bd4f2e (patch)
tree7a90cdeb44b0dd38e5527752e6b654d36f6d7283 /lib/chef
parent208c83ffed15ea8379244fba750dc31a39572fd5 (diff)
downloadchef-9971affd88292c4da8afaf2c2b06571757bd4f2e.tar.gz
Add --exit-on-error option to knife sshryan/knife_ssh_on_error
Diffstat (limited to 'lib/chef')
-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|