-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bootstrap: Fix for performing sudo operations once sudo password ente… #11654
Bootstrap: Fix for performing sudo operations once sudo password ente… #11654
Conversation
becaf3d
to
a33c95e
Compare
knife/lib/chef/knife/bootstrap.rb
Outdated
@@ -712,6 +713,9 @@ def do_connect(conn_options) | |||
conn_options[:sudo_password] = sudo_password | |||
|
|||
retry | |||
elsif e.message =~ /Sudo failed: \S+/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to handle this message in train
rather than doing ssh literal text parsing both here and hidden in the train lib - we could supply a reason
of :sudo_access_failed
, and handle that here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I will do that same. Thanks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@marcparadise I have raised this PR on train repo - inspec/train#690 with required changes. Please take a look
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment nline
a33c95e
to
4ab6433
Compare
I am keeping this PR open.. since once chef/train inspec/train#690 changes are merged. We will need to handle |
@msys-sgarg have the train fixes necessary for this been merged? |
@tas50 train PR is still pending for review. It has been updated as per review inspec/train#690 quite some time back |
The train changes are merged and pulled into chef/chef. |
…nal on sudo error-s
4ab6433
to
5aff158
Compare
…red by user
Signed-off-by: smriti sgarg@msystechnologies.com
Description
knife bootstrap --use-sudo-password
command if is executed for systems where sudo password is used for every operation. A default train error is shown to user as of now.With current change we are handling
Train::UserError
in knife code and display a user friendly error message with instructions which will help user to performknife bootstrap
operation successfully.Related Issue
#11359
Types of changes
Checklist: