diff --git a/pylxd/models/certificate.py b/pylxd/models/certificate.py index eb616cf3..ec3daaf1 100644 --- a/pylxd/models/certificate.py +++ b/pylxd/models/certificate.py @@ -53,12 +53,13 @@ def all(cls, client): def create( cls, client, - secret, + password, cert_data, cert_type="client", name="", projects=None, restricted=False, + secret="", ): """Create a new certificate.""" cert = x509.load_pem_x509_certificate(cert_data, default_backend()) @@ -73,9 +74,9 @@ def create( "projects": projects, } if client.has_api_extension("explicit_trust_token"): - data["trust_token"] = secret + data["trust_token"] = secret or password else: - data["password"] = secret + data["password"] = password response = client.api.certificates.post(json=data) location = response.headers["Location"] fingerprint = location.split("/")[-1]