zoph: Ensure that database server is running when setting up app

When mysql server is not running, app installation fails. Similarly the setup
process will fail when app is being upgrade and database upgrade needs to be
performed. So, ensure that database server is running before attempting
install/upgrade of app.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Sunil Mohan Adapa 2024-03-08 14:58:03 -08:00 committed by James Valleroy
parent ec52d9bed9
commit c341a531dd
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -102,7 +102,11 @@ class ZophApp(app_module.App):
def setup(self, old_version):
"""Install and configure the app."""
privileged.pre_install()
super().setup(old_version)
with self.get_component('shared-daemon-zoph-mysql').ensure_running():
# Database needs to be running for successful initialization or
# upgrade of zoph database.
super().setup(old_version)
privileged.setup()
if not old_version:
self.enable()