mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-07 10:04:03 +00:00
Clarify container.remove() behaviour (#2235)
This commit is contained in:
@@ -39,7 +39,6 @@ class DockerRunner:
|
|||||||
) -> None:
|
) -> None:
|
||||||
assert self.container is not None
|
assert self.container is not None
|
||||||
LOGGER.info(f"Removing container {self.container.name} ...")
|
LOGGER.info(f"Removing container {self.container.name} ...")
|
||||||
if self.container:
|
|
||||||
self.container.remove(force=True)
|
self.container.remove(force=True)
|
||||||
LOGGER.info(f"Container {self.container.name} removed")
|
LOGGER.info(f"Container {self.container.name} removed")
|
||||||
|
|
||||||
|
@@ -92,5 +92,9 @@ class TrackedContainer:
|
|||||||
|
|
||||||
def remove(self) -> None:
|
def remove(self) -> None:
|
||||||
"""Kills and removes the tracked docker container."""
|
"""Kills and removes the tracked docker container."""
|
||||||
if self.container:
|
if self.container is None:
|
||||||
|
LOGGER.info("No container to remove")
|
||||||
|
else:
|
||||||
|
LOGGER.info(f"Removing container {self.container.name} ...")
|
||||||
self.container.remove(force=True)
|
self.container.remove(force=True)
|
||||||
|
LOGGER.info(f"Container {self.container.name} removed")
|
||||||
|
Reference in New Issue
Block a user