Skip to content

Commit 0dada84

Browse files
committed
fix docker_util logic
1 parent 1dc64ce commit 0dada84

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

workflow/docker_util.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,14 @@ def is_container_running(container_name: str) -> bool:
5656

5757
# the current container is not running (cant be found) -> False
5858
except docker.errors.NotFound as ex:
59-
print(f"{ex.explanation}")
6059
return False
6160

6261
# APIErrors can happen
6362
except docker.errors.APIError as ex:
6463
print(f"{ex.explanation}")
6564
client.close()
66-
return False
67-
65+
sys.exit()
66+
6867
# check container status here, means that current container is probably running
6968
else:
7069
container_state = container.attrs["State"]
@@ -169,8 +168,6 @@ def run_docker(self) -> None:
169168
if is_container_running(self.client_name):
170169
print(f"container: {self.client} is running, please stop container and run workflow again")
171170
sys.exit()
172-
else:
173-
print(f"start {self.client} container ...")
174171

175172
container_settings = self.DOCKER_SETTINGS.get(
176173
self.client_name, lambda: f'invalid client: {self.client}')()

0 commit comments

Comments
 (0)