You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the following call, I would expect this to work.
import fabric
connect_kwargs = {"username": "foo", "password": "bar"}
with fabric.Connection(host=host, port=22, connect_kwargs=connect_kwargs) as conn:
...
instead, I receive
ValueError: Refusing to be ambiguous: connect() kwarg 'username' was given both via regular arg and via connect_kwargs!
This error is confusing and probably wrong. If username is set to None, there should be nothing to be ambiguous about, but if the current behavior is upheld, the error message should probably change. I don't recall this being a problem in older releases.
The text was updated successfully, but these errors were encountered:
I believe this issue is arising because fabric is merging ~/.ssh/config with your given config. I am seeing this even when username is not in kwargs because fabric is adding it on its own
connection.py - 406:409
# NOTE: we load SSH config data as early as possible as it has
# potential to affect nearly every other attribute.
#: The per-host SSH config data, if any. (See :ref:`ssh-config`.)
self.ssh_config = self.config.base_ssh_config.lookup(host)
imho this should be optional behavior as it is introducing unexpected behavior to explicit connection arguments
For Fabric 2.5 on python 3.6 (Ubuntu 18.04.1)
For the following call, I would expect this to work.
instead, I receive
ValueError: Refusing to be ambiguous: connect() kwarg 'username' was given both via regular arg and via connect_kwargs!
This error is confusing and probably wrong. If
username
is set to None, there should be nothing to be ambiguous about, but if the current behavior is upheld, the error message should probably change. I don't recall this being a problem in older releases.The text was updated successfully, but these errors were encountered: