Stop all containers if install.sh fails

This commit is contained in:
Disassembler 2020-04-06 09:50:41 +02:00
parent b3f2a4be70
commit d70fe9756a
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499

View File

@ -98,7 +98,13 @@ class App:
for container,container_defintion in definition['containers'].items(): for container,container_defintion in definition['containers'].items():
self.create_container(container, container_defintion) self.create_container(container, container_defintion)
# Run install script and register the app # 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()) repo_local.register_app(self.name, self.get_definition())
def update(self, observer=None): def update(self, observer=None):