From 4ebe16af14d73cd943683f456f26149ddf49fabf Mon Sep 17 00:00:00 2001 From: Einar Forselv Date: Fri, 6 Dec 2019 08:21:21 +0100 Subject: [PATCH] Properly get the container exit code --- src/restic_compose_backup/backup_runner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/restic_compose_backup/backup_runner.py b/src/restic_compose_backup/backup_runner.py index a1b37a1..08ad86e 100644 --- a/src/restic_compose_backup/backup_runner.py +++ b/src/restic_compose_backup/backup_runner.py @@ -57,9 +57,9 @@ def run(image: str = None, command: str = None, volumes: dict = None, fd.write('\n') logger.info(line) + container.wait() container.reload() logger.debug("Container ExitCode %s", container.attrs['State']['ExitCode']) - container.stop() container.remove() return container.attrs['State']['ExitCode']