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

Tests:

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

- Disable wordpress 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:57:30 -08:00 committed by James Valleroy
parent d79ba1cede
commit 717e8cd7f5
No known key found for this signature in database
GPG Key ID: 77C0C75E7B650808

View File

@ -36,8 +36,9 @@ def setup():
db_password = _generate_secret_key(16)
_create_config_file(DB_HOST, DB_NAME, DB_USER, db_password)
_create_database(DB_NAME)
_set_privileges(DB_HOST, DB_NAME, DB_USER, db_password)
with action_utils.service_ensure_running('mysql'):
_create_database(DB_NAME)
_set_privileges(DB_HOST, DB_NAME, DB_USER, db_password)
def _create_config_file(db_host, db_name, db_user, db_password):