Loading behave_utils/docker.py +12 −6 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ from __future__ import annotations import ipaddress import json import logging from contextlib import contextmanager from pathlib import Path from secrets import token_hex Loading Loading @@ -218,7 +219,10 @@ class Container(Item): details = self.inspect() if details.path('$.State.Status', str) == 'exited': code = details.path('$.State.ExitCode', int) raise ProcessLookupError(f"container {self.cid} exited ({code})") if code != 0: logging.getLogger(__name__).warning( f"container {self.cid} exited ({code})", ) return ( self.cid is not None and details.path('$.State.Running', bool) Loading Loading @@ -265,8 +269,10 @@ class Container(Item): """ if self.cid is None: return try: if self.is_running(): docker_quiet('container', 'stop', self.cid) finally: if rm: docker_quiet('container', 'rm', self.cid) self.cid = None Loading Loading
behave_utils/docker.py +12 −6 Original line number Diff line number Diff line Loading @@ -12,6 +12,7 @@ from __future__ import annotations import ipaddress import json import logging from contextlib import contextmanager from pathlib import Path from secrets import token_hex Loading Loading @@ -218,7 +219,10 @@ class Container(Item): details = self.inspect() if details.path('$.State.Status', str) == 'exited': code = details.path('$.State.ExitCode', int) raise ProcessLookupError(f"container {self.cid} exited ({code})") if code != 0: logging.getLogger(__name__).warning( f"container {self.cid} exited ({code})", ) return ( self.cid is not None and details.path('$.State.Running', bool) Loading Loading @@ -265,8 +269,10 @@ class Container(Item): """ if self.cid is None: return try: if self.is_running(): docker_quiet('container', 'stop', self.cid) finally: if rm: docker_quiet('container', 'rm', self.cid) self.cid = None Loading