summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2020-04-11 00:57:45 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2020-04-11 00:57:45 +0530
commite9e76f6396281ec281365971d8e55e6cb35dcd07 (patch)
tree2ba3be9210b82d7b19fb1ccc70d7b18f476090f6
parent19fa0835e9540e7d93dcd2ca57f38f1a78a5ed92 (diff)
downloadchef-VSingh/fix-sudo-password-error.tar.gz
Match reason :bad_sudo_password for wrong attemptVSingh/fix-sudo-password-error
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r--lib/chef/knife/bootstrap.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/knife/bootstrap.rb b/lib/chef/knife/bootstrap.rb
index b1b0c1ceeb..d0b33628ee 100644
--- a/lib/chef/knife/bootstrap.rb
+++ b/lib/chef/knife/bootstrap.rb
@@ -701,9 +701,9 @@ class Chef
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
- elsif config[:use_sudo_password] && (e.reason == :sudo_password_required || e.reason == :sudo_root_password_required) && limit < 3
+ elsif config[:use_sudo_password] && (e.reason == :sudo_password_required || e.reason == :bad_sudo_password) && limit < 3
ui.warn("Failed to authenticate #{conn_options[:user]} to #{server_name} - #{e.message} \n sudo: #{limit} incorrect password attempt")
- sudo_password = ui.ask("Enter sudo root password for #{conn_options[:user]}@#{server_name}:") do |q|
+ sudo_password = ui.ask("Enter sudo password for #{conn_options[:user]}@#{server_name}:") do |q|
q.echo = false
end
limit += 1