- Notifications
You must be signed in to change notification settings - Fork 88
Read the username and port from /.ssh/config file and replace if present #659
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
Read the username and port from /.ssh/config file and replace if present #659
Conversation
Signed-off-by: sanga17 <sausekar@msystechnologies.com>
| Hello sanga1794! Thanks for the pull request! Here is what will happen next:
Thank you for contributing! |
Signed-off-by: sanga17 <sausekar@msystechnologies.com>
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 this is a great contribution! However, we need to make sure that the precedence is correct. Thanks!
| @bastion_host = @options.delete(:bastion_host) | ||
| @bastion_user = @options.delete(:bastion_user) | ||
| @bastion_port = @options.delete(:bastion_port) | ||
| check_config_options |
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 might suggest the name read_options_from_ssh_config. The word check implies that there is some validation going on.
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.
sure will do @clintoncwolfe, thanks
Signed-off-by: sanga17 <sausekar@msystechnologies.com>
| @clintoncwolfe please have a look on updated PR. Thanks! |
| This PR is waiting on an update from @sanga1794 to fix the precedence. Do you think you will have time to make the change? |
…uts from cli Signed-off-by: sanga17 <sausekar@msystechnologies.com>
Signed-off-by: sanga17 <sausekar@msystechnologies.com>
| @clintoncwolfe I have updated the precedence, please have a look. Thanks!! |
lib/train/options.rb Outdated
| if default.is_a? Proc | ||
| res[field] = default.call(res) | ||
| elsif hm.key?(:coerce) | ||
| field_value = hm[:coerce].call(res[:host]) |
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 don't think it makes sense in general to pass the hostname to the Proc. Instead, just pass the options hash (res) to the Proc, and let the Proc internally access the field that it needs (if any - here both will need host).
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.
Sure i'll make those changes. Thanks @clintoncwolfe !!
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.
Overall this looks good! I just have one minor change requested - to alter what is passed to the Proc.
Signed-off-by: sanga17 <sausekar@msystechnologies.com>
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! Thanks for your work on this - I think it has a lot of future potential!
Signed-off-by: sanga17 sausekar@msystechnologies.com
Description
Read the username and port from /.ssh/config file and replace if present
Related Issue
Fixes #101
Types of changes
Checklist: