From 61b4f9d8f83960d738effee7878ac1e2a3b212da Mon Sep 17 00:00:00 2001 From: VirtuBox Date: Sat, 31 Aug 2019 01:02:16 +0200 Subject: [PATCH] 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',