MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / stop

Method stop

camel/runtime/docker_runtime.py:328–348  ·  view source on GitHub ↗

r"""stop the Docker container. Args: remove (Optional[bool]): Whether to remove the container after stopping it. (default: :obj: `None`) Returns: DockerRuntime: The DockerRuntime instance.

(self, remove: Optional[bool] = None)

Source from the content-addressed store, hash-verified

326 return self.stop().build()
327
328 def stop(self, remove: Optional[bool] = None) -> "DockerRuntime":
329 r"""stop the Docker container.
330
331 Args:
332 remove (Optional[bool]): Whether to remove the container
333 after stopping it. (default: :obj: `None`)
334
335 Returns:
336 DockerRuntime: The DockerRuntime instance.
337 """
338 if self.container:
339 self.container.stop()
340 if remove is None:
341 remove = self.remove
342 if remove:
343 logger.info("Removing container.")
344 self.container.remove()
345 self.container = None
346 else:
347 logger.warning("No container to stop.")
348 return self
349
350 @property
351 def ok(self) -> bool:

Callers 2

resetMethod · 0.95
__exit__Method · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected