From e198be060d6eb0c3eb56ed0abd13ebaba2edffbc Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Fri, 30 Aug 2019 23:58:49 +0200 Subject: [PATCH 1/3] Fix MySQL variable --- wo/core/variables.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/wo/core/variables.py b/wo/core/variables.py index d31594e..fa97644 100644 --- a/wo/core/variables.py +++ b/wo/core/variables.py @@ -147,10 +147,9 @@ class WOVariables(): if wo_distro == 'raspbian': wo_mysql = ["mariadb-server", "percona-toolkit", "python3-mysqldb"] - elif wo_distro == 'debian': - if wo_platform_codename == 'jessie': - wo_mysql = ["mariadb-server", "percona-toolkit", - "python3-mysql.connector"] + elif wo_platform_codename == 'jessie': + wo_mysql = ["mariadb-server", "percona-toolkit", + "python3-mysql.connector"] else: wo_mysql = ["mariadb-server", "percona-toolkit", "python3-mysqldb", "mariadb-backup"] From 5ee448f802362c0b6b1912b00ffa58ccadc88d8b Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 00:59:11 +0200 Subject: [PATCH 2/3] Fix display message --- wo/cli/plugins/stack_upgrade.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wo/cli/plugins/stack_upgrade.py b/wo/cli/plugins/stack_upgrade.py index 33a2f9b..3809d6f 100644 --- a/wo/cli/plugins/stack_upgrade.py +++ b/wo/cli/plugins/stack_upgrade.py @@ -57,12 +57,13 @@ class WOStackUpgradeController(CementBaseController): ] @expose(hide=True) - def default(self): + def default(self, disp_msg=False): # All package update apt_packages = [] packages = [] nginx_packages = [] empty_packages = [] + self.msg = [] pargs = self.app.pargs if ((not pargs.web) and (not pargs.nginx) and From 61b4f9d8f83960d738effee7878ac1e2a3b212da Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 01:02:16 +0200 Subject: [PATCH 3/3] Fix display message --- wo/cli/plugins/stack_pref.py | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/wo/cli/plugins/stack_pref.py b/wo/cli/plugins/stack_pref.py index 2be7ad9..9f5bc26 100644 --- a/wo/cli/plugins/stack_pref.py +++ b/wo/cli/plugins/stack_pref.py @@ -359,7 +359,6 @@ def post_pref(self, apt_packages, packages, upgrade=False): WOTemplate.render(self, '/etc/nginx/sites-available/22222', '22222.mustache', data, overwrite=False) - passwd = ''.join([random.choice (string.ascii_letters + string.digits) for n in range(24)]) @@ -468,23 +467,23 @@ def post_pref(self, apt_packages, packages, upgrade=False): "/var/www/22222/cert/22222.key;\n") server_ip = requests.get('http://v4.wordops.eu') - if set(["nginx"]).issubset(set(apt_packages)): - print("WordOps backend configuration was successful\n" - "You can access it on : https://{0}:22222" - .format(server_ip)) - print("HTTP Auth User Name: WordOps" + - "\nHTTP Auth Password : {0}".format(passwd)) - WOService.reload_service(self, 'nginx') - else: - self.msg = (self.msg + ["HTTP Auth User " - "Name: WordOps"] + - ["HTTP Auth Password : {0}" - .format(passwd)]) - self.msg = (self.msg + ["WordOps backend is available " - "on https://{0}:22222 " - "or https://{1}:22222" - .format(server_ip.text, - WOVariables.wo_fqdn)]) + if set(["nginx"]).issubset(set(apt_packages)): + print("WordOps backend configuration was successful\n" + "You can access it on : https://{0}:22222" + .format(server_ip)) + print("HTTP Auth User Name: WordOps" + + "\nHTTP Auth Password : {0}".format(passwd)) + WOService.reload_service(self, 'nginx') + else: + self.msg = (self.msg + ["HTTP Auth User " + "Name: WordOps"] + + ["HTTP Auth Password : {0}" + .format(passwd)]) + self.msg = (self.msg + ["WordOps backend is available " + "on https://{0}:22222 " + "or https://{1}:22222" + .format(server_ip.text, + WOVariables.wo_fqdn)]) if not os.path.isfile("/opt/cf-update.sh"): WOTemplate.render(self, '/opt/cf-update.sh',