3232import subprocess # nosec B404
3333from typing import TYPE_CHECKING
3434
35- from ansys .tools .common .path import get_available_ansys_installations , get_latest_ansys_installation
3635from ansys .tools .common .cyberchannel import verify_transport_mode , verify_uds_socket
36+ from ansys .tools .common .path import get_available_ansys_installations , get_latest_ansys_installation
3737
3838from ansys .geometry .core .connection .backend import ApiVersions , BackendType
3939from ansys .geometry .core .logger import LOG
@@ -546,12 +546,11 @@ def prepare_and_start_backend(
546546 # Assign environment variables as needed
547547 if transport_values ["certs_dir" ]:
548548 env_copy ["ANSYS_GRPC_CERTIFICATES" ] = certs_dir
549-
549+
550550 # On SpaceClaim and Discovery, we need to change the "--" to "/"
551551 if backend_type in (BackendType .DISCOVERY , BackendType .SPACECLAIM ):
552552 exe_args = [arg .replace ("--" , "/" ) for arg in exe_args ]
553553
554-
555554 LOG .info (f"Launching ProductInstance for { backend_type .name } " )
556555 LOG .debug (f"Args: { args } " )
557556 LOG .debug (f"Exe args: { exe_args } " )
@@ -634,7 +633,7 @@ def _wait_for_backend(host: str, port: int, timeout: int, transport_values: dict
634633 else :
635634 LOG .debug ("Still waiting for backend to be ready... Retrying in 5 seconds." )
636635 time .sleep (5 )
637-
636+
638637 raise ConnectionError ("Timeout while waiting for backend to be ready." )
639638
640639
@@ -800,7 +799,6 @@ def _get_common_env(
800799 return env_copy
801800
802801
803-
804802def _handle_transport_mode (
805803 host : str ,
806804 transport_mode : str | None = None ,
@@ -926,4 +924,4 @@ def _handle_transport_mode(
926924 }
927925
928926 # Return the args to be passed to the backend, and the transport values
929- return exe_args , transport_values
927+ return exe_args , transport_values
0 commit comments