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 authored and James Valleroy committed 2024-03-11 16:50:12 -04:00
1 parent d79ba1cede
commit 717e8cd7f5
1 file changed
+3 -2
+3 -2
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):