From baa7ac0be0ad0377e1347548581e5d6a7520cc22 Mon Sep 17 00:00:00 2001 From: German <28149841+germa89@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:28:51 +0100 Subject: [PATCH] fix: checking port on non-grpc mapdl instances (#3540) * fix: checking port on non-grpc mapdl instances * chore: adding changelog file 3540.fixed.md [dependabot-skip] --------- Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> --- doc/changelog.d/3540.fixed.md | 1 + src/ansys/mapdl/core/cli/list_instances.py | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 doc/changelog.d/3540.fixed.md diff --git a/doc/changelog.d/3540.fixed.md b/doc/changelog.d/3540.fixed.md new file mode 100644 index 0000000000..b524a5f16d --- /dev/null +++ b/doc/changelog.d/3540.fixed.md @@ -0,0 +1 @@ +fix: checking port on non-grpc mapdl instances \ No newline at end of file diff --git a/src/ansys/mapdl/core/cli/list_instances.py b/src/ansys/mapdl/core/cli/list_instances.py index 644fa75d00..36d6d5b9df 100644 --- a/src/ansys/mapdl/core/cli/list_instances.py +++ b/src/ansys/mapdl/core/cli/list_instances.py @@ -125,9 +125,13 @@ def get_port(proc): ind_grpc = cmdline.index("-port") return cmdline[ind_grpc + 1] + def is_grpc_based(proc): + cmdline = proc.cmdline() + return "-grpc" in cmdline + table = [] for each_p in mapdl_instances: - if instances and not each_p.ansys_instance: + if not each_p.ansys_instance or not is_grpc_based(each_p): continue proc_line = []