Fix PrometheusAPIClient set_client_cert

The session doesn't have a 'key' property, instead it expects
a '(cert, key)' pair to be assigned to the 'cert' property.

See: https://docs.python-requests.org/en/latest/api/#requests.Session.cert

Change-Id: I3ae5c5b4f36dfd0b17126ee563ce4912e2765af2
Signed-off-by: Jaromir Wysoglad <jwysogla@redhat.com>
This commit is contained in:
Jaromir Wysoglad
2025-08-12 17:12:16 -04:00
parent 2f31846d73
commit bcadbfe670

View File

@@ -70,8 +70,7 @@ class PrometheusAPIClient(object):
self._session.verify = ca_cert
def set_client_cert(self, client_cert, client_key):
self._session.cert = client_cert
self._session.key = client_key
self._session.cert = (client_cert, client_key)
def set_basic_auth(self, auth_user, auth_password):
self._session.auth = (auth_user, auth_password)