From e5d685e054c3852e1e452735eb027f7358ed703a Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Wed, 4 Sep 2019 17:04:25 +0200 Subject: [PATCH] Make stack install cleaner --- wo/cli/plugins/site_functions.py | 12 +++++++++++- wo/cli/plugins/stack.py | 27 ++++++++------------------- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/wo/cli/plugins/site_functions.py b/wo/cli/plugins/site_functions.py index 1181ef0..7afdc8a 100644 --- a/wo/cli/plugins/site_functions.py +++ b/wo/cli/plugins/site_functions.py @@ -863,7 +863,17 @@ def site_package_check(self, stype): if stype in ['mysql', 'wp', 'wpsubdir', 'wpsubdomain']: Log.debug(self, "Setting apt_packages variable for MySQL") if not WOShellExec.cmd_exec(self, "/usr/bin/mysqladmin ping"): - apt_packages = apt_packages + WOVariables.wo_mysql + if not WOVariables.wo_distro == 'raspbian': + if (not WOVariables.wo_platform_codename == 'jessie'): + wo_mysql = ["mariadb-server", "percona-toolkit", + "python3-mysqldb", "mariadb-backup"] + else: + wo_mysql = ["mariadb-server", "percona-toolkit", + "python3-mysql.connector"] + else: + wo_mysql = ["mariadb-server", "percona-toolkit", + "python3-mysqldb"] + apt_packages = apt_packages + wo_mysql if stype in ['wp', 'wpsubdir', 'wpsubdomain']: Log.debug(self, "Setting packages variable for WP-CLI") diff --git a/wo/cli/plugins/stack.py b/wo/cli/plugins/stack.py index b09b4f3..46e5555 100644 --- a/wo/cli/plugins/stack.py +++ b/wo/cli/plugins/stack.py @@ -225,31 +225,20 @@ class WOStackController(CementBaseController): # MariaDB 10.3 if pargs.mysql: - if not WOVariables.wo_distro == 'raspbian': - if (not WOVariables.wo_platform_codename == 'jessie'): - if ((not WOFileUtils.grep( - self, "/etc/apt/sources.list.d/wo-repo.list", - "10.1")) and - (not WOFileUtils.grep( - self, "/etc/apt/sources.list.d/wo-repo.list", - "10.1"))): - + pargs.mysqltuner = True + Log.debug(self, "Setting apt_packages variable for MySQL") + if not WOShellExec.cmd_exec(self, "mysqladmin ping"): + if not WOVariables.wo_distro == 'raspbian': + if (not WOVariables.wo_platform_codename == 'jessie'): wo_mysql = ["mariadb-server", "percona-toolkit", "python3-mysqldb", "mariadb-backup"] else: wo_mysql = ["mariadb-server", "percona-toolkit", - "python3-mysqldb"] + "python3-mysql.connector"] else: wo_mysql = ["mariadb-server", "percona-toolkit", - "python3-mysql.connector"] - else: - wo_mysql = ["mariadb-server", "percona-toolkit", - "python3-mysqldb"] - - pargs.mysqltuner = True - Log.debug(self, "Setting apt_packages variable for MySQL") - if not WOShellExec.cmd_exec(self, "mysqladmin ping"): - apt_packages = apt_packages + wo_mysql + "python3-mysqldb"] + apt_packages = apt_packages + wo_mysql else: Log.debug(self, "MySQL already installed and alive") Log.info(self, "MySQL already installed and alive")