mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-26 01:15:08 +00:00
Minor: Fix kafkaconnect test connection (#18965)
This commit is contained in:
parent
fa9ee99458
commit
85c7f6d22e
@ -61,15 +61,18 @@ class KafkaConnectClient:
|
|||||||
"""
|
"""
|
||||||
Get the version and other details of the Kafka Connect cluster.
|
Get the version and other details of the Kafka Connect cluster.
|
||||||
"""
|
"""
|
||||||
try:
|
return self.client.get_cluster_info()
|
||||||
result = self.client.get_cluster_info()
|
|
||||||
return result
|
|
||||||
|
|
||||||
except Exception as exc:
|
def get_connectors_list(
|
||||||
logger.debug(traceback.format_exc())
|
self,
|
||||||
logger.error(f"Unable to get cluster info :{exc}")
|
expand: str = None,
|
||||||
|
pattern: str = None,
|
||||||
return None
|
state: str = None,
|
||||||
|
) -> dict:
|
||||||
|
"""
|
||||||
|
Get the list of connectors from Kafka Connect cluster.
|
||||||
|
"""
|
||||||
|
return self.client.list_connectors(expand=expand, pattern=pattern, state=state)
|
||||||
|
|
||||||
def get_connectors(
|
def get_connectors(
|
||||||
self,
|
self,
|
||||||
@ -85,12 +88,8 @@ class KafkaConnectClient:
|
|||||||
pattern (str): Only list connectors that match the regex pattern.
|
pattern (str): Only list connectors that match the regex pattern.
|
||||||
state (str): Only list connectors that match the state.
|
state (str): Only list connectors that match the state.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
result = self.client.list_connectors(
|
return self.get_connectors_list(expand=expand, pattern=pattern, state=state)
|
||||||
expand=expand, pattern=pattern, state=state
|
|
||||||
)
|
|
||||||
return result
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.debug(traceback.format_exc())
|
logger.debug(traceback.format_exc())
|
||||||
logger.error(f"Unable to get connectors list {exc}")
|
logger.error(f"Unable to get connectors list {exc}")
|
||||||
|
@ -51,7 +51,7 @@ def test_connection(
|
|||||||
|
|
||||||
test_fn = {
|
test_fn = {
|
||||||
"GetClusterInfo": client.get_cluster_info,
|
"GetClusterInfo": client.get_cluster_info,
|
||||||
"GetPipelines": client.get_connectors,
|
"GetPipelines": client.get_connectors_list,
|
||||||
"GetPlugins": client.get_connector_plugins,
|
"GetPlugins": client.get_connector_plugins,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user