train
train copied to clipboard
Fixed ssh connection issue if key_files array is empty
Signed-off-by: sanga17 [email protected]
Description
If key_files set as empty array then failing to ssh connection while bootstrapping the node
Related Issue
https://github.com/chef/chef/issues/7053
Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New content (non-breaking change)
- [ ] Breaking change (a content change which would break existing functionality or processes)
Checklist:
- [x] I have read the CONTRIBUTING document.
Hello sanga1794! Thanks for the pull request!
Here is what will happen next:
- Your PR will be reviewed by the maintainers.
- Possible Outcomes a. If everything looks good, one of them will approve it, and your PR will be merged. b. The maintainer may request follow-on work (e.g. code fix, linting, etc). We would encourage you to address this work in 2-3 business days to keep the conversation going and to get your contribution in sooner. c. Cases exist where a PR is neither aligned to Chef InSpec's product roadmap, or something the team can own or maintain long-term. In these cases, the maintainer will provide justification and close out the PR.
Thank you for contributing!
Is there a bug to link here and can we get a test added for this?
Is there a bug to link here and can we get a test added for this?
@tas I'm working on the issue https://github.com/chef/chef/issues/7053, while trying to bootstrap a node using the ssh config_file, as key_files
from chef
repo is []
(if we didn't mentioned in CLI), then not able to connect with the node using ssh.
@tas50, @marcparadise Please review this PR Thanks!!
How does having an empty array for key_files cause a failure?
How does having an empty array for key_files cause a failure?
@marcparadise below i attached the screenshot which consist of both failing and working Net::SSH.start
method, please have look. Thanks!!
And we are deleting from list of options if value of any variable is nil for reference: https://github.com/inspec/train/blob/7121af0ea78734e4bf8081f14fb72a5f85378477/lib/train/transports/ssh_connection.rb#L213
How does having an empty array for key_files cause a failure?
@marcparadise below i attached the screenshot which consist of both failing and working
Net::SSH.start
method, please have look. Thanks!! And we are deleting from list of options if value of any variable is nil for reference:https://github.com/inspec/train/blob/7121af0ea78734e4bf8081f14fb72a5f85378477/lib/train/transports/ssh_connection.rb#L213
@marcparadise, @tas50 Please have look into this. Thanks!!!
If auth method were public-key,keyboard-interactive
I'd then expect to receive a password prompt (if tty enabled). With just public-key
if the key is not present, it can't succeed. Based on that understanding, it seems like what you're seeing is correct.
Is there something different that you'd expect, or am I misunderstanding something in that output?