Support include directives in ssh_config files#1194
Conversation
paramiko/config.py
Outdated
| self._config = [] | ||
|
|
||
| def parse(self, file_obj): | ||
| def parse(self, file_obj, parsed_files=[]): |
There was a problem hiding this comment.
There's a potential gotcha here - if parse() is called on two separate occasions (non-recursively), the default value the second time will retain the modifications (appends) from the first time parse() was called.
Generally, whenever you want a default value for a param, and you mutate that param, you want it like so:
def func(param=None):
if param is None:
param = []|
Thanks for the review, I pushed a fix for the issue you mentioned. |
|
Looks good to me. (With the caveat that this won't work for |
|
Could you revisit this and let us know what is still missing? Work on this has been available for about 2 years and I'd really like to use this feature in a project. |
|
I too would like to see this revisited and or merged. I'd add a "strip('"') function to the value part though to handle when paths like this "~/.ssh/group/*," which are valid in ssh config. |
|
How about a merge? |
|
How about a merge? 🙏 |
|
How about a merge? |
|
I can't speak directly for @bitprophet, but I'm confident this PR would be considerably strengthened by the addition of tests and documentation. Since OP is no longer on Github, I suspect that probably kills this specific PR. If someone else interested in the feature is willing to take it up, please create a new PR with the code change, plus tests & docs. (Action on this may not be possible until after #872 is handled, however.) |
This is a followup of #872. I have squashed original author commits and added a fix for supporting relative file path in case of system ssh_config files.