Merge branch 'fix_docker_container_removal_already_in_progress' into 'main'

[FIX] Container removal already in progress

Closes #60

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!84
This commit is contained in:
Rémy Taymans 2024-10-03 16:16:12 +00:00
commit 393411f937
2 changed files with 7 additions and 2 deletions

View File

@ -131,6 +131,9 @@ def kill_container(container_name):
try:
container.stop()
container.wait()
if container.status != "removed":
container.remove()
container.wait(condition="removed")
except docker.errors.NotFound as err:
logger.debug(f"Cannot kill container {container.name}: {err}")

View File

@ -33,7 +33,9 @@ def get_postgres_container(ctx):
f"Found container {container_name} in a exited status."
" Removing it..."
)
if container.status != "removed":
container.remove()
container.wait(condition="removed")
else:
return container