Fix wo stack purge
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
|
||||||
|
|
||||||
|
- `wo stack purge --all` failure if mysql isn't installed
|
||||||
|
|
||||||
### v3.9.8.12 - 2019-09-20
|
### v3.9.8.12 - 2019-09-20
|
||||||
|
|
||||||
#### Changed
|
#### Changed
|
||||||
|
|||||||
@@ -794,12 +794,12 @@ class WOStackController(CementBaseController):
|
|||||||
# NGINX
|
# NGINX
|
||||||
if pargs.nginx:
|
if pargs.nginx:
|
||||||
if WOAptGet.is_installed(self, 'nginx-custom'):
|
if WOAptGet.is_installed(self, 'nginx-custom'):
|
||||||
Log.debug(self, "Purge apt_packages variable of Nginx")
|
Log.debug(self, "Add Nginx to apt_packages list")
|
||||||
apt_packages = apt_packages + WOVariables.wo_nginx
|
apt_packages = apt_packages + WOVariables.wo_nginx
|
||||||
|
|
||||||
# PHP
|
# PHP
|
||||||
if pargs.php:
|
if pargs.php:
|
||||||
Log.debug(self, "Purge apt_packages variable PHP")
|
Log.debug(self, "Add PHP to apt_packages list")
|
||||||
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
if WOAptGet.is_installed(self, 'php7.2-fpm'):
|
||||||
if not (WOAptGet.is_installed(self, 'php7.3-fpm')):
|
if not (WOAptGet.is_installed(self, 'php7.3-fpm')):
|
||||||
apt_packages = apt_packages + WOVariables.wo_php + \
|
apt_packages = apt_packages + WOVariables.wo_php + \
|
||||||
@@ -819,50 +819,53 @@ class WOStackController(CementBaseController):
|
|||||||
|
|
||||||
# REDIS
|
# REDIS
|
||||||
if pargs.redis:
|
if pargs.redis:
|
||||||
|
if WOAptGet.is_installed(self, 'redis-server'):
|
||||||
Log.debug(self, "Remove apt_packages variable of Redis")
|
Log.debug(self, "Remove apt_packages variable of Redis")
|
||||||
apt_packages = apt_packages + ["redis-server"]
|
apt_packages = apt_packages + ["redis-server"]
|
||||||
|
|
||||||
# MariaDB
|
# MariaDB
|
||||||
if pargs.mysql:
|
if pargs.mysql:
|
||||||
|
if WOAptGet.is_installed(self, 'mariadb-server'):
|
||||||
Log.debug(self, "Removing apt_packages variable of MySQL")
|
Log.debug(self, "Removing apt_packages variable of MySQL")
|
||||||
apt_packages = apt_packages + ['mariadb-server', 'mysql-common',
|
apt_packages = apt_packages + ['mariadb-server',
|
||||||
|
'mysql-common',
|
||||||
'mariadb-client']
|
'mariadb-client']
|
||||||
packages = packages + ['/etc/mysql', '/var/lib/mysql']
|
packages = packages + ['/etc/mysql', '/var/lib/mysql']
|
||||||
|
|
||||||
# mysqlclient
|
# mysqlclient
|
||||||
if pargs.mysqlclient:
|
if pargs.mysqlclient:
|
||||||
Log.debug(self, "Removing apt_packages variable "
|
|
||||||
"for MySQL Client")
|
|
||||||
if WOShellExec.cmd_exec(self, "mysqladmin ping"):
|
if WOShellExec.cmd_exec(self, "mysqladmin ping"):
|
||||||
|
Log.debug(self, "Add MySQL client to apt_packages list")
|
||||||
apt_packages = apt_packages + WOVariables.wo_mysql_client
|
apt_packages = apt_packages + WOVariables.wo_mysql_client
|
||||||
|
|
||||||
# fail2ban
|
# fail2ban
|
||||||
if pargs.fail2ban:
|
if pargs.fail2ban:
|
||||||
if WOAptGet.is_installed(self, 'fail2ban'):
|
if WOAptGet.is_installed(self, 'fail2ban'):
|
||||||
Log.debug(self, "Remove apt_packages variable of Fail2ban")
|
Log.debug(self, "Add Fail2ban to apt_packages list")
|
||||||
apt_packages = apt_packages + WOVariables.wo_fail2ban
|
apt_packages = apt_packages + WOVariables.wo_fail2ban
|
||||||
|
|
||||||
# ClamAV
|
# ClamAV
|
||||||
if pargs.clamav:
|
if pargs.clamav:
|
||||||
Log.debug(self, "Setting apt_packages variable for ClamAV")
|
Log.debug(self, "Add ClamAV to apt_packages list")
|
||||||
if WOAptGet.is_installed(self, 'clamav'):
|
if WOAptGet.is_installed(self, 'clamav'):
|
||||||
apt_packages = apt_packages + WOVariables.wo_clamav
|
apt_packages = apt_packages + WOVariables.wo_clamav
|
||||||
|
|
||||||
# UFW
|
# UFW
|
||||||
if pargs.ufw:
|
if pargs.ufw:
|
||||||
Log.debug(self, "Remove apt_packages variable for UFW")
|
if WOAptGet.is_installed(self, 'ufw'):
|
||||||
|
Log.debug(self, "Add UFW to apt_packages list")
|
||||||
apt_packages = apt_packages + ["ufw"]
|
apt_packages = apt_packages + ["ufw"]
|
||||||
|
|
||||||
# sendmail
|
# sendmail
|
||||||
if pargs.sendmail:
|
if pargs.sendmail:
|
||||||
Log.debug(self, "Setting apt_packages variable for Sendmail")
|
|
||||||
if WOAptGet.is_installed(self, 'sendmail'):
|
if WOAptGet.is_installed(self, 'sendmail'):
|
||||||
|
Log.debug(self, "Add sendmail to apt_packages list")
|
||||||
apt_packages = apt_packages + ["sendmail"]
|
apt_packages = apt_packages + ["sendmail"]
|
||||||
|
|
||||||
# proftpd
|
# proftpd
|
||||||
if pargs.proftpd:
|
if pargs.proftpd:
|
||||||
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
if WOAptGet.is_installed(self, 'proftpd-basic'):
|
||||||
Log.debug(self, "Purge apt_packages variable for ProFTPd")
|
Log.debug(self, "Add Proftpd to apt_packages list")
|
||||||
apt_packages = apt_packages + ["proftpd-basic"]
|
apt_packages = apt_packages + ["proftpd-basic"]
|
||||||
|
|
||||||
# WP-CLI
|
# WP-CLI
|
||||||
@@ -945,6 +948,8 @@ class WOStackController(CementBaseController):
|
|||||||
WOService.stop_service(self, 'fail2ban')
|
WOService.stop_service(self, 'fail2ban')
|
||||||
|
|
||||||
if (set(["mariadb-server"]).issubset(set(apt_packages))):
|
if (set(["mariadb-server"]).issubset(set(apt_packages))):
|
||||||
|
if (os.path.isfile('/usr/bin/mysql') and
|
||||||
|
os.path.isdir('/var/lib/mysql')):
|
||||||
WOMysql.backupAll(self)
|
WOMysql.backupAll(self)
|
||||||
WOService.stop_service(self, 'mysql')
|
WOService.stop_service(self, 'mysql')
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,8 @@ class WOSyncController(CementBaseController):
|
|||||||
Log.debug(self, "Config files not found in {0}/ "
|
Log.debug(self, "Config files not found in {0}/ "
|
||||||
.format(wo_site_webroot))
|
.format(wo_site_webroot))
|
||||||
if site.site_type != 'mysql':
|
if site.site_type != 'mysql':
|
||||||
Log.debug(self, "Searching wp-config.php in {0}/htdocs/ "
|
Log.debug(self,
|
||||||
|
"Searching wp-config.php in {0}/htdocs/"
|
||||||
.format(wo_site_webroot))
|
.format(wo_site_webroot))
|
||||||
configfiles = glob.glob(
|
configfiles = glob.glob(
|
||||||
wo_site_webroot + '/htdocs/wp-config.php')
|
wo_site_webroot + '/htdocs/wp-config.php')
|
||||||
|
|||||||
Reference in New Issue
Block a user