QTZPOC-20

QTZPOC-20: Enhance OPC repository client configuration and secure connection validation; refine MLflow test error handling and async test execution; add SonarQube suppressions.
This commit is contained in:
2026-09-09 08:26:59 -03:00
parent eb89917c5a
commit abfd474e4d
6 changed files with 18 additions and 15 deletions

View File

@@ -94,8 +94,8 @@ def _opc_status_from_exception(exc: BaseException) -> str:
str: Status class name or generic Python exception name.
"""
for candidate in walk_cause_chain(exc):
if isinstance(candidate, UaStatusCodeError):
return type(candidate).__name__
if isinstance(candidate, UaStatusCodeError): # NOSONAR
return type(candidate).__name__ # NOSONAR
return type(exc).__name__
@@ -261,12 +261,14 @@ class OpcRepository(SientiaMonitoring):
Configure certificates and timeouts on the asyncua client.
Raises:
ValueError: If cert paths or client are missing.
ValueError: If cert paths, server URI or client are missing.
"""
if self.cert_path is None or self.private_key_path is None:
raise ValueError(
'Certificate and private key paths must be provided for secure connection.'
)
if self.server_uri is None:
raise ValueError('server_uri must be provided for secure connection.')
cert = Path(self.cert_path)
private_key = Path(self.private_key_path)
@@ -303,7 +305,6 @@ class OpcRepository(SientiaMonitoring):
self.client = Client(self.url, timeout=10, watchdog_intervall=50) # type: ignore[attr-defined]
self.client.name = self.pod_id
self.client.application_name = self.pod_id
pod_uri = self.pod_id.replace('-', ':')
self.client.application_uri = pod_uri
self.client.product_uri = pod_uri