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:
commit
393411f937
|
|
@ -131,6 +131,9 @@ def kill_container(container_name):
|
||||||
try:
|
try:
|
||||||
container.stop()
|
container.stop()
|
||||||
container.wait()
|
container.wait()
|
||||||
|
if container.status != "removed":
|
||||||
container.remove()
|
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..."
|
||||||
)
|
)
|
||||||
|
if container.status != "removed":
|
||||||
container.remove()
|
container.remove()
|
||||||
|
container.wait(condition="removed")
|
||||||
else:
|
else:
|
||||||
return container
|
return container
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user