diff options
author | Ryan Cragun <me@ryan.ec> | 2015-02-18 17:58:28 -0800 |
---|---|---|
committer | Ryan Cragun <me@ryan.ec> | 2015-03-03 10:40:32 -0800 |
commit | 9971affd88292c4da8afaf2c2b06571757bd4f2e (patch) | |
tree | 7a90cdeb44b0dd38e5527752e6b654d36f6d7283 /lib | |
parent | 208c83ffed15ea8379244fba750dc31a39572fd5 (diff) | |
download | chef-9971affd88292c4da8afaf2c2b06571757bd4f2e.tar.gz |
Add --exit-on-error option to knife sshryan/knife_ssh_on_error
Diffstat (limited to 'lib')
-rw-r--r-- | lib/chef/knife/ssh.rb | 7 |
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| |