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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user