Skip to content

Commit

Permalink
pylxd/client: fix auth without password support
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Deziel <[email protected]>
  • Loading branch information
simondeziel committed Sep 9, 2024
1 parent a1ac877 commit 025169e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pylxd/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,11 @@ def authenticate(self, secret):
if self.trusted:
return
cert = open(self.api.session.cert[0]).read().encode("utf-8")
self.certificates.create(secret, cert)

if self.has_api_extension("explicit_trust_token"):
self.certificates.create(secret=secret, cert)
else:
self.certificates.create(password=secret, cert)

# Refresh the host info
response = self.api.get()
Expand Down

0 comments on commit 025169e

Please sign in to comment.