summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2019-08-21 11:06:39 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2019-08-21 11:06:39 +0530
commit1ea61ba8bb6a7f455fb535f2b3626fcfbc53932d (patch)
tree306deab9f91f6a7bb1a7da9452828375e9b33e02
parent6a492b1d3fdd03638e16495b82392afa8680d2bb (diff)
downloadchef-1ea61ba8bb6a7f455fb535f2b3626fcfbc53932d.tar.gz
Fix chefstyle
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r--lib/chef/knife/bootstrap.rb20
1 files changed, 9 insertions, 11 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index 4395fded71..612e119760 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -670,17 +670,15 @@ class Chef
end
def do_connect(conn_options)
- begin
- @connection = TrainConnector.new(host_descriptor, connection_protocol, conn_options)
- connection.connect!
- rescue Train::UserError => e
- if !conn_options.key?(:pty) && e.message =~ /Sudo requires a TTY/
- ui.warn("#{e.message} - trying with pty request")
- conn_options[:pty] = true # ensure we can talk to systems with requiretty set true in sshd config
- retry
- else
- raise
- end
+ @connection = TrainConnector.new(host_descriptor, connection_protocol, conn_options)
+ connection.connect!
+ rescue Train::UserError => e
+ if !conn_options.key?(:pty) && e.message =~ /Sudo requires a TTY/
+ ui.warn("#{e.message} - trying with pty request")
+ conn_options[:pty] = true # ensure we can talk to systems with requiretty set true in sshd config
+ retry
+ else
+ raise
end
end