Skip to content

Commit

Permalink
Fix product version in launch remote fluent. (#1604)
Browse files Browse the repository at this point in the history
* Fix product version in launch remote fluent.

* Fix test.

* Remove commented lines.

---------

Co-authored-by: Your Name <[email protected]>
  • Loading branch information
prmukherj and Your Name authored May 19, 2023
1 parent a958c92 commit acf81cd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
8 changes: 7 additions & 1 deletion src/ansys/fluent/core/launcher/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,11 +649,17 @@ def launch_fluent(
logger.info(
"Starting Fluent remotely. The startup configuration will be ignored."
)

if product_version:
fluent_product_version = "".join(product_version.split("."))[:-1]
else:
fluent_product_version = "latest"

return launch_remote_fluent(
session_cls=new_session,
start_timeout=start_timeout,
start_transcript=start_transcript,
product_version="".join(get_ansys_version().split("."))[:-1],
product_version=fluent_product_version,
cleanup_on_exit=cleanup_on_exit,
meshing_mode=meshing_mode,
dimensionality=version,
Expand Down
7 changes: 2 additions & 5 deletions tests/test_launcher_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,9 @@ def test_launch_remote_instance(monkeypatch, new_solver_session):
# Assert: PyFluent went through the pypim workflow
assert mock_is_configured.called
assert mock_connect.called
if os.getenv("FLUENT_IMAGE_TAG"):
product_version = docker_image_version.get_version_for_filepath()
else:
product_version = "".join(launcher.get_ansys_version().split("."))[:-1]

mock_client.create_instance.assert_called_with(
"fluent-3ddp", product_version=product_version
"fluent-3ddp", product_version="latest"
)
assert mock_instance.wait_for_ready.called
mock_instance.build_grpc_channel.assert_called_with()
Expand Down

0 comments on commit acf81cd

Please sign in to comment.