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 authored and James Valleroy committed 2024-03-11 16:50:40 -04:00
1 parent ec52d9bed9
commit c341a531dd
1 file changed
+5 -1
+5 -1
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()