Skip to content

Commit a8fe837

Browse files
committed
fix
1 parent 2ff2b15 commit a8fe837

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/ansys/dpf/core/server_types.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
from ansys.dpf.core import __version__, errors, server_context, server_factory
5151
from ansys.dpf.core._version import min_server_version, server_to_ansys_version
5252
from ansys.dpf.core.check_version import server_meet_version
53-
from ansys.dpf.core.server_context import ServerContext
53+
from ansys.dpf.core.server_context import AvailableServerContexts, ServerContext
5454
from ansys.dpf.gate import data_processing_grpcapi, load_api
5555

5656
if TYPE_CHECKING: # pragma: no cover
@@ -132,7 +132,11 @@ def _run_launch_server_process(
132132
if os.name == "nt":
133133
executable = "Ans.Dpf.Grpc.bat"
134134
run_cmd = f"{executable} --address {ip} --port {port}"
135-
if context is not None:
135+
if context not in (
136+
None,
137+
AvailableServerContexts.entry,
138+
AvailableServerContexts.premium,
139+
):
136140
run_cmd += f" --context {int(context.licensing_context_type)}"
137141
else:
138142
executable = "./Ans.Dpf.Grpc.sh" # pragma: no cover
@@ -141,7 +145,11 @@ def _run_launch_server_process(
141145
f"--address {ip}",
142146
f"--port {port}",
143147
] # pragma: no cover
144-
if context is not None:
148+
if context not in (
149+
None,
150+
AvailableServerContexts.entry,
151+
AvailableServerContexts.premium,
152+
):
145153
run_cmd.append(f"--context {int(context.licensing_context_type)}")
146154
path_in_install = load_api._get_path_in_install(internal_folder="bin")
147155
dpf_run_dir = _verify_ansys_path_is_valid(ansys_path, executable, path_in_install)

0 commit comments

Comments
 (0)