summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthew Horan & Ryan Ong <pair+mhoran+rong@pivotallabs.com>2012-11-29 12:05:07 -0500
committerBryan McLellan <btm@opscode.com>2012-12-14 08:39:58 -0800
commitf2f6530b027b4942a7ec2e15d925f61a3654978b (patch)
treecbf52295ea0f2eb1c422de44ab1fb628678d497d /lib
parentb3a4d702ce636adfba5978fa5e3e8081328d7232 (diff)
downloadchef-f2f6530b027b4942a7ec2e15d925f61a3654978b.tar.gz
CHEF-2627: Exit with non-zero exit code when ssh command fails
Diffstat (limited to 'lib')
-rw-r--r--lib/chef/knife/ssh.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/chef/knife/ssh.rb b/lib/chef/knife/ssh.rb
index ed3c559d05..f5054f0b6f 100644
--- a/lib/chef/knife/ssh.rb
+++ b/lib/chef/knife/ssh.rb
@@ -145,7 +145,7 @@ class Chef
ui.fatal("No nodes returned from search!")
else
ui.fatal("#{@action_nodes.length} #{@action_nodes.length > 1 ? "nodes":"node"} found, " +
- "but do not have the required attribute to stablish the connection. " +
+ "but does not have the required attribute to establish the connection. " +
"Try setting another attribute to open the connection using --attribute.")
end
exit 10
@@ -439,7 +439,11 @@ class Chef
end
session.close
- exit_status
+ if exit_status != 0
+ exit exit_status
+ else
+ exit_status
+ end
end
end