Skip to content
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

The example with "localhost" and "uname" is broken #379

Open
PPPW opened this issue May 18, 2023 · 1 comment
Open

The example with "localhost" and "uname" is broken #379

PPPW opened this issue May 18, 2023 · 1 comment

Comments

@PPPW
Copy link

PPPW commented May 18, 2023

For general questions please use the mail group.

Describe the bug
The example in the README is broken:

from pssh.clients import ParallelSSHClient

hosts = ['localhost', 'localhost']
client = ParallelSSHClient(hosts)

output = client.run_command('uname')

To Reproduce
Run the above example.

Expected behavior
The above code runs successfully.

Actual behaviour
The above code got exception:

Traceback (most recent call last):
  File "/home/azureuser/.local/lib/python3.10/site-packages/pssh/clients/base/single.py", line 204, in _auth_retry
    self.auth()
  File "/home/azureuser/.local/lib/python3.10/site-packages/pssh/clients/base/single.py", line 364, in auth
    return self._identity_auth()
  File "/home/azureuser/.local/lib/python3.10/site-packages/pssh/clients/base/single.py", line 337, in _identity_auth
    raise AuthenticationError("No authentication methods succeeded")
pssh.exceptions.AuthenticationError: No authentication methods succeeded
...
pssh.exceptions.AuthenticationError: ('Authentication error while connecting to %s:%s - %s - retries %s/%s', 'localhost', 22, AuthenticationError('No authentication methods succeeded'), 3, 3)

Additional information
The issue happens when no auth is needed, e.g., SSH to localhost, or to a host without the need of -i. The ParallelSSHClient's constructor takes identity_auth=False, however with that, in /pssh/clients/base/single.py, it will try to do password auth, which also doesn't apply. This looks like a regression. Could you fix that and support uses cases that auth is not needed? Thank you!

@christiankotait
Copy link

Same issue. Can you please fix this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants