Make sure the containers are stopped before uninstalling
This commit is contained in:
parent
d4bbce2dcf
commit
6df8bf0616
@ -87,11 +87,11 @@ class App:
|
||||
repo_local.register_app(self.name, self.get_definition())
|
||||
|
||||
def update(self):
|
||||
# Load the local repo data here instead set_definition() to avoid fully defining containers which may not exist already
|
||||
definition = repo_local.get_app(self.name)
|
||||
# Remove containers
|
||||
for container in definition['containers']:
|
||||
Container(container, False).destroy()
|
||||
# Load the local repo data here instead set_definition() to avoid fully defining containers which may not exist already
|
||||
containers = [Container(container, False) for container in repo_local.get_app(self.name)['containers']]
|
||||
for container in containers:
|
||||
container.destroy()
|
||||
# Load online definition
|
||||
definition = repo_online.get_app(self.name)
|
||||
self.version = definition['version']
|
||||
@ -104,12 +104,16 @@ class App:
|
||||
repo_local.register_app(self.name, self.get_definition())
|
||||
|
||||
def uninstall(self):
|
||||
self.run_script('uninstall')
|
||||
# Make sure the containers are stopped
|
||||
# Load the local repo data here instead set_definition() to avoid fully defining containers which may not exist already
|
||||
definition = repo_local.get_app(self.name)
|
||||
containers = [Container(container, False) for container in repo_local.get_app(self.name)['containers']]
|
||||
for container in containers:
|
||||
container.stop()
|
||||
# Run uninstall script
|
||||
self.run_script('uninstall')
|
||||
# Remove containers
|
||||
for container in definition['containers']:
|
||||
Container(container, False).destroy()
|
||||
for container in containers:
|
||||
container.destroy()
|
||||
# Unregister app and remove scripts
|
||||
repo_local.unregister_app(self.name)
|
||||
try:
|
||||
|
Loading…
Reference in New Issue
Block a user