-
Notifications
You must be signed in to change notification settings - Fork 19
Solution to https://github.com/fsspec/sshfs/issues/54 #57
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
Changes from all commits
1c70799
da82e76
e812dae
96998aa
dcd13ed
de2efbd
d761a1f
b4f2dcc
c74e397
e5abf2a
830b36d
723065b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,29 +1,44 @@ | ||||||
| import getpass | ||||||
| from contextlib import suppress | ||||||
| from pathlib import Path | ||||||
| import asyncssh | ||||||
|
|
||||||
| from asyncssh.config import SSHClientConfig | ||||||
|
|
||||||
| SSH_CONFIG = Path("~", ".ssh", "config").expanduser() | ||||||
|
|
||||||
|
|
||||||
| def parse_config( | ||||||
| *, host, user=(), port=(), local_user=None, config_files=None | ||||||
| ): | ||||||
| def parse_config(*, host, user=(), port=(), local_user=None, config_files=None): | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd also add a warning that the function is deprecated. |
||||||
| if config_files is None: | ||||||
| config_files = [SSH_CONFIG] | ||||||
|
|
||||||
| if local_user is None: | ||||||
| with suppress(KeyError): | ||||||
| with suppress(OSError): # Use OSError as getuser() might raise this. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's keep
Suggested change
|
||||||
| local_user = getpass.getuser() | ||||||
|
|
||||||
| last_config = None | ||||||
| reload = False | ||||||
|
|
||||||
| return SSHClientConfig.load( | ||||||
| # Check asyncssh version | ||||||
| version = tuple(map(int, asyncssh.__version__.split("."))) | ||||||
| if version <= (2, 18, 0): # Compare version properly | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| return SSHClientConfig.load( | ||||||
| last_config, | ||||||
| config_files, | ||||||
| reload, | ||||||
| local_user, | ||||||
| user, | ||||||
| host, | ||||||
| port, | ||||||
| ) | ||||||
| canonical = False # Fixed typo | ||||||
| final = False # Fixed typo | ||||||
| return SSHClientConfig.load( | ||||||
| last_config, | ||||||
| config_files, | ||||||
| reload, | ||||||
| canonical, # Use correct parameter | ||||||
| final, # Use correct parameter | ||||||
|
Comment on lines
+40
to
+41
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. All these comments are unnecessary. |
||||||
| local_user, | ||||||
| user, | ||||||
| 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.
Let's keep it this way: