Closed bennnnnnnn closed 3 months ago
hey @bennnnnnnn with so many n
's!
hmm, yeah this is a good one. I dislike the idea of changing the ssh_config_file
arg since that would be obviously be a big change to the public side of things. I very much like the idea of just dropping the -F bit if ssh_config_file
is just True
though, that seems like a much better idea. If it's still explicit we can still explicitly set it of course.
implementing this in my old spaghetti mess may be a bit annoying since the transport just gets an empty string or a path. since we already pass the transport to the _setup_ssh_file_args
method though I guess we could just have another check for "if transport is system and ssh_config_file is true, then return some special placeholder" then the transport could just check if the ssh_config_file is like "yes" (obviously not that but you get the idea) then we know to not put any -F arg in...
thoughts? ima have to sleep on it probably but if you think that sounds sane would you be down for a pr?
Hi Carl,
Fully agree with your points above! Also don't be so harsh on your older code :-)
I'll send in a PR.
PS: This is a fantastic package! Amazing you built this by yourself, keep up the great work!
thanks @bennnnnnnn ! will close this and we can follow up in the pr, thanks for raising this and the work on it!!
Describe the bug Currently setting ssh_config_file to True and using the system transport, the logic in _resolve_ssh_config from the BaseDriver still collapses this to a single file (first the user config file, then the system config file) to pass using -F to the actual ssh client.
This means that if a user has a user config file, any config existing in the system config file will not get picked up.
To Reproduce
Expected behavior I understand this abstraction exists because of the different ssh clients which don't have native ssh config support, but I think it would be better to omit the -F if ssh_config_file is True. Optionally ssh_config_files could also become a list and we could then pass both user and system config to the ssh client. (some changes probably needed to the config parsing code for the other ssh clients then). Maybe there could also be a separate flag to read the system config files, separate from the ssh_config_file argument?