parent
1f95377efa
commit
f649627d63
|
|
@ -131,6 +131,9 @@ def kill_container(container_name):
|
||||||
try:
|
try:
|
||||||
container.stop()
|
container.stop()
|
||||||
container.wait()
|
container.wait()
|
||||||
container.remove()
|
if container.status != "removed":
|
||||||
|
container.remove()
|
||||||
|
container.wait(condition="removed")
|
||||||
|
|
||||||
except docker.errors.NotFound as err:
|
except docker.errors.NotFound as err:
|
||||||
logger.debug(f"Cannot kill container {container.name}: {err}")
|
logger.debug(f"Cannot kill container {container.name}: {err}")
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,9 @@ def get_postgres_container(ctx):
|
||||||
f"Found container {container_name} in a exited status."
|
f"Found container {container_name} in a exited status."
|
||||||
" Removing it..."
|
" Removing it..."
|
||||||
)
|
)
|
||||||
container.remove()
|
if container.status != "removed":
|
||||||
|
container.remove()
|
||||||
|
container.wait(condition="removed")
|
||||||
else:
|
else:
|
||||||
return container
|
return container
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user