Fix MySQL purge with remote MySQL server
This commit is contained in:
@@ -8,6 +8,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|||||||
|
|
||||||
### v3.9.x - [Unreleased]
|
### v3.9.x - [Unreleased]
|
||||||
|
|
||||||
|
#### Fixed
|
||||||
|
|
||||||
|
- MySQL databases backup when using remote MySQL server
|
||||||
|
|
||||||
### v3.11.4 - 2020-01-17
|
### v3.11.4 - 2020-01-17
|
||||||
|
|
||||||
#### Fixed
|
#### Fixed
|
||||||
|
|||||||
@@ -1123,20 +1123,17 @@ class WOStackController(CementBaseController):
|
|||||||
if start_purge != "Y" and start_purge != "y":
|
if start_purge != "Y" and start_purge != "y":
|
||||||
Log.error(self, "Not starting stack purge")
|
Log.error(self, "Not starting stack purge")
|
||||||
|
|
||||||
if (set(["nginx-custom"]).issubset(set(apt_packages))):
|
if "nginx-custom" in apt_packages:
|
||||||
WOService.stop_service(self, 'nginx')
|
WOService.stop_service(self, 'nginx')
|
||||||
|
|
||||||
if (set(["fail2ban"]).issubset(set(apt_packages))):
|
if "fail2ban" in apt_packages:
|
||||||
WOService.stop_service(self, 'fail2ban')
|
WOService.stop_service(self, 'fail2ban')
|
||||||
|
|
||||||
if (set(["mariadb-server"]).issubset(set(apt_packages))):
|
if "mariadb-server" in apt_packages:
|
||||||
if self.app.config.has_section('stack'):
|
if self.app.config.has_section('mysql'):
|
||||||
database_host = self.app.config.get(
|
if self.app.config.get(
|
||||||
'stack', 'ip-address')
|
'mysql', 'grant-host') == 'localhost':
|
||||||
else:
|
WOMysql.backupAll(self)
|
||||||
database_host = 'na'
|
|
||||||
if database_host == '127.0.0.1':
|
|
||||||
WOMysql.backupAll(self)
|
|
||||||
WOService.stop_service(self, 'mysql')
|
WOService.stop_service(self, 'mysql')
|
||||||
|
|
||||||
# Netdata uninstaller
|
# Netdata uninstaller
|
||||||
|
|||||||
@@ -31,9 +31,8 @@ class WOMysql():
|
|||||||
# Makes connection with MySQL server
|
# Makes connection with MySQL server
|
||||||
try:
|
try:
|
||||||
if os.path.exists('/etc/mysql/conf.d/my.cnf'):
|
if os.path.exists('/etc/mysql/conf.d/my.cnf'):
|
||||||
connection = \
|
connection = pymysql.connect(
|
||||||
pymysql.connect(read_default_file='/etc/mysql/'
|
read_default_file='/etc/mysql/conf.d/my.cnf')
|
||||||
'conf.d/my.cnf')
|
|
||||||
else:
|
else:
|
||||||
connection = pymysql.connect(read_default_file='~/.my.cnf')
|
connection = pymysql.connect(read_default_file='~/.my.cnf')
|
||||||
return connection
|
return connection
|
||||||
|
|||||||
Reference in New Issue
Block a user