At the bottom of my ~/.ssh/config, I have this section because my local username doesn't match my most common remote username:
When running pytest, any paramiko host always uses the kmccormick user, even though I specify vagrant. It's the same whether it is set on the command line or in conftest.py with get_host, e.g.:
pytest --hosts "paramiko://vagrant@127.0.0.1:2222"
get_host("paramiko://vagrant@127.0.0.1:2222")
This breaks the convention with ssh and ssh_config where earlier options override later options; command line options should override anything in ssh_config. It looks like it's had the same behavior since ~/.ssh/config was added as a fallback in 5c3388c4.
_load_ssh_config() should only set cfg["username"] = value if user isn't already set. That should probably also be extended out to other settings besides just username.
I'm working around this by supplying an ssh config file. Even /dev/null will do.
At the bottom of my ~/.ssh/config, I have this section because my local username doesn't match my most common remote username:
When running pytest, any paramiko host always uses the kmccormick user, even though I specify vagrant. It's the same whether it is set on the command line or in conftest.py with get_host, e.g.:
This breaks the convention with ssh and ssh_config where earlier options override later options; command line options should override anything in ssh_config. It looks like it's had the same behavior since ~/.ssh/config was added as a fallback in 5c3388c4.
_load_ssh_config()should only setcfg["username"] = valueif user isn't already set. That should probably also be extended out to other settings besides just username.I'm working around this by supplying an ssh config file. Even /dev/null will do.