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 <simon.deziel@canonical.com>
  • Loading branch information
simondeziel committed Sep 9, 2024
1 parent 0e98777 commit 794cf8f
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 794cf8f

Please sign in to comment.