Skip to content

Commit

Permalink
fix download cert in get_api call
Browse files Browse the repository at this point in the history
  • Loading branch information
robzor92 committed Jan 29, 2024
1 parent 37ae494 commit c82b552
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
4 changes: 0 additions & 4 deletions python/hopsworks/core/kafka_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import socket
from hopsworks.client.external import Client


class KafkaApi:
def __init__(
self,
Expand Down Expand Up @@ -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(),
Expand Down
4 changes: 0 additions & 4 deletions python/hopsworks/core/opensearch_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}],
Expand Down
6 changes: 6 additions & 0 deletions python/hopsworks/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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):
Expand Down

0 comments on commit c82b552

Please sign in to comment.