diff options
author | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-08-21 08:52:54 +0530 |
---|---|---|
committer | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-08-21 08:52:54 +0530 |
commit | 6a492b1d3fdd03638e16495b82392afa8680d2bb (patch) | |
tree | 0bed4fdb3e278eeed5e584aa548d5a76d05b3736 | |
parent | 5194689e252ad7caabc37eb60bde13de35ea06ee (diff) | |
download | chef-6a492b1d3fdd03638e16495b82392afa8680d2bb.tar.gz |
Remove retry_require boolean & check on pty key
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r-- | lib/chef/knife/bootstrap.rb | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb index 8ded1451ef..4395fded71 100644 --- a/lib/chef/knife/bootstrap.rb +++ b/lib/chef/knife/bootstrap.rb @@ -670,14 +670,12 @@ class Chef end def do_connect(conn_options) - retry_require = true begin @connection = TrainConnector.new(host_descriptor, connection_protocol, conn_options) connection.connect! rescue Train::UserError => e - if retry_require && e.message =~ /Sudo requires a TTY/ + if !conn_options.key?(:pty) && e.message =~ /Sudo requires a TTY/ ui.warn("#{e.message} - trying with pty request") - retry_require = false conn_options[:pty] = true # ensure we can talk to systems with requiretty set true in sshd config retry else |