From d70fe9756a978e231a504fdc740a829bf343ad55 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Mon, 6 Apr 2020 09:50:41 +0200 Subject: [PATCH] Stop all containers if install.sh fails --- usr/lib/python3.8/spoc/app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr/lib/python3.8/spoc/app.py b/usr/lib/python3.8/spoc/app.py index 640147f..95a6999 100644 --- a/usr/lib/python3.8/spoc/app.py +++ b/usr/lib/python3.8/spoc/app.py @@ -98,7 +98,13 @@ class App: for container,container_defintion in definition['containers'].items(): self.create_container(container, container_defintion) # Run install script and register the app - self.run_script('install') + try: + self.run_script('install') + except: + # Stop all containers if install.sh fails + for container in self.containers: + container.stop() + raise repo_local.register_app(self.name, self.get_definition()) def update(self, observer=None):