Skip to content

Commit

Permalink
Add version parsing for comparison within check_ansys_grpc_dpf_version()
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi committed Oct 12, 2023
1 parent 5a4aa75 commit 79d5d7a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ansys/dpf/core/server_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def _compare_ansys_grpc_dpf_version(right_grpc_module_version_str: str, grpc_mod

def check_ansys_grpc_dpf_version(server, timeout):
import grpc
from packaging import version

state = grpc.channel_ready_future(server.channel)
# verify connection has matured
Expand All @@ -337,7 +338,7 @@ def check_ansys_grpc_dpf_version(server, timeout):
f"Failed to connect to {server._input_ip}:{server._input_port} in {timeout} seconds"
)
LOG.debug("Established connection to DPF gRPC")
if server.version < min_server_version:
if version.parse(server.version) < version.parse(min_server_version):
raise ValueError(f"Error connecting via gRPC to DPF server version {server.version} "

Check warning on line 342 in src/ansys/dpf/core/server_types.py

View check run for this annotation

Codecov / codecov/patch

src/ansys/dpf/core/server_types.py#L342

Added line #L342 was not covered by tests
f"(ANSYS {server_to_ansys_version[server.version]}): "
f"ansys-dpf-core {__version__} does not support DPF servers below "
Expand Down

0 comments on commit 79d5d7a

Please sign in to comment.