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 3f8ff39
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(cert, secret=secret)
else:
self.certificates.create(cert, password=secret)

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

0 comments on commit 3f8ff39

Please sign in to comment.