Properly get the container exit code

This commit is contained in:
Einar Forselv 2019-12-06 08:21:21 +01:00
parent fd87ddc388
commit 4ebe16af14
1 changed files with 1 additions and 1 deletions

View File

@ -57,9 +57,9 @@ def run(image: str = None, command: str = None, volumes: dict = None,
fd.write('\n') fd.write('\n')
logger.info(line) logger.info(line)
container.wait()
container.reload() container.reload()
logger.debug("Container ExitCode %s", container.attrs['State']['ExitCode']) logger.debug("Container ExitCode %s", container.attrs['State']['ExitCode'])
container.stop()
container.remove() container.remove()
return container.attrs['State']['ExitCode'] return container.attrs['State']['ExitCode']