From 794cf8f79996004792329d5bcc8641e3bbdafa92 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 9 Sep 2024 17:17:05 -0400 Subject: [PATCH] pylxd/client: fix auth without password support Signed-off-by: Simon Deziel --- pylxd/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pylxd/client.py b/pylxd/client.py index c5c5c1eb..236139e1 100644 --- a/pylxd/client.py +++ b/pylxd/client.py @@ -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()