-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
Don't correctly parse contain @ ssh password #752
Comments
Did you try to urlencode the password ? e.g.:
|
Thanks, it works, and it works in ansible as well. But I'm handling passwords via environment variables, so I can't use urlencode anywhere (unless maintained separately). Is it a good idea to use pytest-testinfra/testinfra/backend/base.py Lines 241 to 247 in dc48cd9
if "@" in name:
user, name = name.rsplit("@", 1) |
With Since there is no general solution, I suggest to leave the code as it is and to extend the documentation with #783. |
version:
testinfra-10.0.0
pytest --hosts=ssh://root:foo@[email protected] test.py -vvv
Captured log:
DEBUG testinfra:base.py:328 RUN CommandResult(backend=<testinfra.backend.ssh.SshBackend object at 0x7f1514287490>, exit_status=5, command=b"sshpass -p foo ssh -o User=root -o ConnectTimeout=10 -o ControlMaster=auto -o ControlPersist=60s [email protected] 'uname -s'", _stdout=b'', _stderr=b'Permission denied, please try again.\r\n')
The text was updated successfully, but these errors were encountered: