-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Gracefully fail when env.use_ssh_config == True but there is no config file #587
Comments
I think that's fine, but it should at least emit a warning of some kind, the reason it fails hard right now is that |
Fair enough. Although the use case I bumped into was: we're using Fabric to automate a build/deploy system that a few different people can trigger (on the command-line or via Jenkins), and some of these people require ~/.ssh/config to be read (because they use different keys for different hosts), and some don't (because they use a single key that's used by default). Doesn't seem to be so far fetched. Anyway, I'll write a small patch and do a pull request a bit later today. Thanks! |
While it's a relatively crude method, you might want to experiment with setting It's been a while but I believe that will correctly activate the setting for those users. Worth trying, especially since it could eliminate the discussed warning that some of your users would have to see every time. |
Ironically I got bit by this myself just recently in a very similar situation to @rbp. Don't see a PR but AFAICT all we need to do is change the abort to a warn -- I am not sure why it was an abort to begin with. Doing this now. |
If env.use_ssh_config is True, Fabric tries to load the env.ssh_config_path. However, if that is not set, or if the config file is not present, fabric aborts.
It would be very handy to be have env.use_ssh_config gracefully fall back to returning an empty dict when there is no config file available, just like ssh would behave (i.e., use config file if available, otherwise carry on with defaults).
If this makes sense, I'll be glad to provide a patch (even if it turns out not to be as trivial as it seems).
The text was updated successfully, but these errors were encountered: