Merge pull request #131 from WordOps/updating-configuration

Updating configuration
This commit is contained in:
VirtuBox
2019-08-31 01:19:49 +02:00
committed by GitHub
3 changed files with 22 additions and 23 deletions

View File

@@ -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',

View File

@@ -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

View File

@@ -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"]