fix stack issues

* fix php7.2 stack detection
* add php7.3 as php7.0 replacement
This commit is contained in:
VirtuBox
2019-03-02 20:38:31 +01:00
parent 698d982fc2
commit 79d45044f9
19 changed files with 544 additions and 651 deletions

View File

@@ -15,13 +15,13 @@ class WOStackStatusController(CementBaseController):
arguments = [
(['--memcache'],
dict(help='start/stop/restart memcache', action='store_true')),
]
]
@expose(help="Start stack services")
def start(self):
"""Start services"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
or self.app.pargs.redis):
self.app.pargs.nginx = True
@@ -29,43 +29,43 @@ class WOStackStatusController(CementBaseController):
self.app.pargs.mysql = True
if self.app.pargs.nginx:
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
services = services + ['nginx']
else:
Log.info(self, "Nginx is not installed")
if self.app.pargs.php:
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
if WOAptGet.is_installed(self, 'php5-fpm'):
services = services + ['php5-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5-FPM is not installed")
Log.info(self, "PHP7.2-FPM is not installed")
else:
if WOAptGet.is_installed(self, 'php5.6-fpm'):
services = services + ['php5.6-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5.6-FPM is not installed")
Log.info(self, "PHP7.2-FPM is not installed")
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
if self.app.pargs.php7:
if self.app.pargs.php73:
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
Log.info(self, "PHP7.3-FPM is not installed")
else:
Log.info(self, "Your platform does not support PHP 7")
Log.info(self, "Your platform does not support PHP 7.3")
if self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
(WOVariables.wo_mysql_host is "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql']
else:
Log.info(self, "MySQL is not installed")
@@ -98,7 +98,7 @@ class WOStackStatusController(CementBaseController):
def stop(self):
"""Stop services"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
or self.app.pargs.redis):
self.app.pargs.nginx = True
@@ -106,43 +106,43 @@ class WOStackStatusController(CementBaseController):
self.app.pargs.mysql = True
if self.app.pargs.nginx:
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
services = services + ['nginx']
else:
Log.info(self, "Nginx is not installed")
if self.app.pargs.php:
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
if WOAptGet.is_installed(self, 'php5-fpm'):
services = services + ['php5-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5-FPM is not installed")
else:
if WOAptGet.is_installed(self, 'php5.6-fpm'):
services = services + ['php5.6-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5.6-FPM is not installed")
Log.info(self, "PHP7.2-FPM is not installed")
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
if self.app.pargs.php7:
if self.app.pargs.php73:
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
Log.info(self, "PHP7.3-FPM is not installed")
else:
Log.info(self, "Your platform does not support PHP 7")
Log.info(self, "Your platform does not support PHP 7.3")
if self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
(WOVariables.wo_mysql_host is "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql']
else:
Log.info(self, "MySQL is not installed")
@@ -175,7 +175,7 @@ class WOStackStatusController(CementBaseController):
def restart(self):
"""Restart services"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
or self.app.pargs.redis):
self.app.pargs.nginx = True
@@ -183,44 +183,43 @@ class WOStackStatusController(CementBaseController):
self.app.pargs.mysql = True
if self.app.pargs.nginx:
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
services = services + ['nginx']
else:
Log.info(self, "Nginx is not installed")
if self.app.pargs.php:
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
if WOAptGet.is_installed(self, 'php5-fpm'):
services = services + ['php5-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5-FPM is not installed")
Log.info(self, "PHP7.2-FPM is not installed")
else:
if WOAptGet.is_installed(self, 'php5.6-fpm'):
services = services + ['php5.6-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5.6-FPM is not installed")
Log.info(self, "PHP7.2-FPM is not installed")
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
if self.app.pargs.php7:
if self.app.pargs.php73:
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
Log.info(self, "PHP7.3-FPM is not installed")
else:
Log.info(self, "Your platform does not support PHP 7")
Log.info(self, "Your platform does not support PHP 7.3")
if self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
(WOVariables.wo_mysql_host is "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql']
else:
Log.info(self, "MySQL is not installed")
@@ -253,7 +252,7 @@ class WOStackStatusController(CementBaseController):
def status(self):
"""Status of services"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
or self.app.pargs.redis):
self.app.pargs.nginx = True
@@ -262,43 +261,43 @@ class WOStackStatusController(CementBaseController):
self.app.pargs.hhvm = True
if self.app.pargs.nginx:
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
services = services + ['nginx']
else:
Log.info(self, "Nginx is not installed")
if self.app.pargs.php:
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
if WOAptGet.is_installed(self, 'php5-fpm'):
services = services + ['php5-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5-FPM is not installed")
Log.info(self, "PHP7.2-FPM is not installed")
else:
if WOAptGet.is_installed(self, 'php5.6-fpm'):
services = services + ['php5.6-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5.6-FPM is not installed")
Log.info(self, "PHP7.2-FPM is not installed")
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
if self.app.pargs.php7:
if self.app.pargs.php73:
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
Log.info(self, "PHP7.3-FPM is not installed")
else:
Log.info(self, "Your platform does not support PHP 7")
Log.info(self, "Your platform does not support PHP 7.3")
if self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
(WOVariables.wo_mysql_host is "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql']
else:
Log.info(self, "MySQL is not installed")
@@ -331,51 +330,51 @@ class WOStackStatusController(CementBaseController):
def reload(self):
"""Reload service"""
services = []
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php7
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
if not (self.app.pargs.nginx or self.app.pargs.php or self.app.pargs.php73
or self.app.pargs.mysql or self.app.pargs.hhvm or self.app.pargs.memcache
or self.app.pargs.redis):
self.app.pargs.nginx = True
self.app.pargs.php = True
self.app.pargs.mysql = True
if self.app.pargs.nginx:
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self,'nginx-mainline'):
if WOAptGet.is_installed(self, 'nginx-custom') or WOAptGet.is_installed(self, 'nginx-mainline'):
services = services + ['nginx']
else:
Log.info(self, "Nginx is not installed")
if self.app.pargs.php:
if (WOVariables.wo_platform_distro == 'debian' or WOVariables.wo_platform_codename == 'precise'):
if WOAptGet.is_installed(self, 'php5-fpm'):
services = services + ['php5-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5-FPM is not installed")
Log.info(self, "PHP7.2-FPM is not installed")
else:
if WOAptGet.is_installed(self, 'php5.6-fpm'):
services = services + ['php5.6-fpm']
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP5.6-FPM is not installed")
Log.info(self, "php7.2-fpm is not installed")
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
if self.app.pargs.php7:
if self.app.pargs.php73:
if (WOVariables.wo_platform_codename == 'trusty' or WOVariables.wo_platform_codename == 'xenial' or WOVariables.wo_platform_codename == 'bionic'):
if WOAptGet.is_installed(self, 'php7.2-fpm'):
services = services + ['php7.2-fpm']
if WOAptGet.is_installed(self, 'php7.3-fpm'):
services = services + ['php7.3-fpm']
else:
Log.info(self, "PHP7.2-FPM is not installed")
Log.info(self, "PHP7.3-FPM is not installed")
else:
Log.info(self, "Your platform does not support PHP 7")
if self.app.pargs.mysql:
if ((WOVariables.wo_mysql_host is "localhost") or
(WOVariables.wo_mysql_host is "127.0.0.1")):
(WOVariables.wo_mysql_host is "127.0.0.1")):
if (WOAptGet.is_installed(self, 'mysql-server') or
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
WOAptGet.is_installed(self, 'percona-server-server-5.6') or
WOAptGet.is_installed(self, 'mariadb-server')):
services = services + ['mysql']
else:
Log.info(self, "MySQL is not installed")
@@ -391,7 +390,7 @@ class WOStackStatusController(CementBaseController):
services = services + ['memcached']
else:
Log.info(self, "Memcache is not installed")
if self.app.pargs.redis:
if WOAptGet.is_installed(self, 'redis-server'):
services = services + ['redis-server']