zoph: Don't fail setup if mysql installed but not running

Tests:

- Install wordpress and disable it. This will install mysql and disable it. Then
install zoph installation should succeed.

- Disable zoph and re-run setup. Setup should succeed.

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-07 17:56:11 -08:00 committed by James Valleroy
parent a488ee4d43
commit d79ba1cede
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -42,16 +42,20 @@ def _zoph_configure(key, value):
@privileged
def setup():
"""Setup Zoph configuration."""
_zoph_configure('import.enable', 'true')
_zoph_configure('import.upload', 'true')
_zoph_configure('import.rotate', 'true')
_zoph_configure('path.unzip', 'unzip')
_zoph_configure('path.untar', 'tar xvf')
_zoph_configure('path.ungz', 'gunzip')
"""Setup Zoph configuration.
# Maps using OpenStreetMap is enabled by default.
_zoph_configure('maps.provider', 'osm')
May be called when app is disabled.
"""
with action_utils.service_ensure_running('mysql'):
_zoph_configure('import.enable', 'true')
_zoph_configure('import.upload', 'true')
_zoph_configure('import.rotate', 'true')
_zoph_configure('path.unzip', 'unzip')
_zoph_configure('path.untar', 'tar xvf')
_zoph_configure('path.ungz', 'gunzip')
# Maps using OpenStreetMap is enabled by default.
_zoph_configure('maps.provider', 'osm')
def _get_db_name():