Fix MariaDB upgrade

This commit is contained in:
VirtuBox
2020-10-22 12:05:01 +02:00
parent c72ce642b4
commit 55f50f583c
2 changed files with 5 additions and 6 deletions

View File

@@ -933,11 +933,8 @@ def post_pref(self, apt_packages, packages, upgrade=False):
config_file.close()
else:
# make sure root account have all privileges
if "IDENTIFIED BY PASSWORD" not in WOShellExec.cmd_exec_stdout(
self, 'mysql -e "use mysql; show grants;"'):
if os.path.exists('/etc/mysql/conf.d/my.cnf.tmp'):
try:
if not os.path.exists('/etc/mysql/conf.d/my.cnf.tmp'):
Log.error(self, 'my.cnf not found')
config = configparser.ConfigParser()
config.read('/etc/mysql/conf.d/my.cnf.tmp')
chars = config['client']['password']
@@ -981,10 +978,11 @@ def post_pref(self, apt_packages, packages, upgrade=False):
inno_buffer=wo_ram_innodb,
inno_log_buffer=wo_ram_log_buffer,
innodb_instances=wo_innodb_instance,
newmariadb=mariadbconf)
newmariadb=mariadbconf, release=WOVar.wo_version)
if os.path.exists('/etc/mysql/mariadb.conf.d/50-server.cnf'):
WOTemplate.deploy(
self, '/etc/mysql/my.cnf', 'my.mustache', data)
self, '/etc/mysql/mariadb.conf.d/50-server.cnf',
'my.mustache', data)
else:
WOTemplate.deploy(
self, '/etc/mysql/my.cnf', 'my.mustache', data)

View File

@@ -1,4 +1,5 @@
# MariaDB database server configuration file.
# Optimized by WordOps {{release}}
#
# You can copy this file to one of:
# - "/etc/mysql/my.cnf" to set global options,