diff --git a/python/hopsworks/core/kafka_api.py b/python/hopsworks/core/kafka_api.py index b999eb1cf..2c598f929 100644 --- a/python/hopsworks/core/kafka_api.py +++ b/python/hopsworks/core/kafka_api.py @@ -20,7 +20,6 @@ import socket from hopsworks.client.external import Client - class KafkaApi: def __init__( self, @@ -349,9 +348,6 @@ def get_default_config(self): # Raises `RestAPIError`: If unable to get the kafka configuration. """ - _client = client.get_instance() - if type(_client) == Client: - _client.download_certs(self._project_name) config = { constants.KAFKA_SSL_CONFIG.SECURITY_PROTOCOL_CONFIG: self._get_security_protocol(), diff --git a/python/hopsworks/core/opensearch_api.py b/python/hopsworks/core/opensearch_api.py index 8606195d8..076717e9b 100644 --- a/python/hopsworks/core/opensearch_api.py +++ b/python/hopsworks/core/opensearch_api.py @@ -83,10 +83,6 @@ def get_default_py_config(self): Returns: A dictionary with required configuration. """ - _client = client.get_instance() - if type(_client) == Client: - _client.download_certs(self._project_name) - url = furl(self._get_opensearch_url()) return { constants.OPENSEARCH_CONFIG.HOSTS: [{"host": url.host, "port": url.port}], diff --git a/python/hopsworks/project.py b/python/hopsworks/project.py index dac726319..1ae45fb0a 100644 --- a/python/hopsworks/project.py +++ b/python/hopsworks/project.py @@ -176,6 +176,9 @@ def get_kafka_api(self): # Returns `KafkaApi`: The Kafka Api handle """ + _client = client.get_instance() + if type(_client) == Client: + _client.download_certs(self.name) return self._kafka_api def get_opensearch_api(self): @@ -184,6 +187,9 @@ def get_opensearch_api(self): # Returns `OpenSearchApi`: The OpenSearch Api handle """ + _client = client.get_instance() + if type(_client) == Client: + _client.download_certs(self.name) return self._opensearch_api def get_jobs_api(self):