Skip to content

Commit 1af654a

Browse files
committed
[OMCProcessDocker] improve handling of interactive port
1 parent 0a5a9e9 commit 1af654a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

OMPython/OMCSession.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,11 +666,13 @@ def _omc_command_get(self, omc_path_and_args_list) -> list:
666666

667667
if self._docker:
668668
if sys.platform == "win32":
669-
if self._interactivePort is not None and isinstance(self._interactivePort, int):
669+
if isinstance(self._interactivePort, str):
670670
p = int(self._interactivePort)
671-
dockerNetworkStr = ["-p", "127.0.0.1:%d:%d" % (p, p)]
671+
elif isinstance(self._interactivePort, int):
672+
p = self._interactivePort
672673
else:
673674
raise OMCSessionException("Missing or invalid interactive port!")
675+
dockerNetworkStr = ["-p", "127.0.0.1:%d:%d" % (p, p)]
674676
elif self._dockerNetwork == "host" or self._dockerNetwork is None:
675677
dockerNetworkStr = ["--network=host"]
676678
elif self._dockerNetwork == "separate":

0 commit comments

Comments
 (0)