Skip to content

Commit cf0f68d

Browse files
committed
[OMCProcessDockerHelper] fix _docker_process_get() - definition of docker_cid
1 parent 05b2f37 commit cf0f68d

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

OMPython/OMCSession.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -623,13 +623,13 @@ def __init__(
623623
self._dockerCid: Optional[str] = None
624624
self._docker_process: Optional[DummyPopen] = None
625625

626-
def _docker_process_get(self) -> Optional[DummyPopen]:
626+
def _docker_process_get(self, docker_cid: str) -> Optional[DummyPopen]:
627627
if sys.platform == 'win32':
628628
raise NotImplementedError("Docker not supported on win32!")
629629

630630
docker_process = None
631631
for idx in range(0, 40):
632-
dockerTop = subprocess.check_output(["docker", "top", self._dockerCid]).decode().strip()
632+
dockerTop = subprocess.check_output(["docker", "top", docker_cid]).decode().strip()
633633
docker_process = None
634634
for line in dockerTop.split("\n"):
635635
columns = line.split()
@@ -826,7 +826,7 @@ def _docker_omc_start(self) -> Tuple[subprocess.Popen, DummyPopen, str]:
826826
raise OMCSessionException(f"Docker did not start (timeout={self._timeout} might be too short "
827827
"especially if you did not docker pull the image before this command).")
828828

829-
docker_process = self._docker_process_get()
829+
docker_process = self._docker_process_get(docker_cid=docker_cid)
830830
if docker_process is None:
831831
raise OMCSessionException(f"Docker top did not contain omc process {self._random_string}. "
832832
f"Log-file says:\n{self.get_log()}")
@@ -911,7 +911,7 @@ def _docker_omc_start(self) -> Tuple[subprocess.Popen, DummyPopen]:
911911

912912
docker_process = None
913913
if isinstance(self._dockerCid, str):
914-
docker_process = self._docker_process_get()
914+
docker_process = self._docker_process_get(docker_cid=self._dockerCid)
915915

916916
if docker_process is None:
917917
raise OMCSessionException(f"Docker top did not contain omc process {self._random_string} "

0 commit comments

Comments
 (0)