Few improvements

This commit is contained in:
VirtuBox
2019-08-01 10:39:15 +02:00
parent c863284e96
commit ba376c037b
3 changed files with 11 additions and 5 deletions

View File

@@ -3,7 +3,7 @@
from cement.core.controller import CementBaseController, expose from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook from cement.core import handler, hook
from wo.core.aptget import WOAptGet from wo.core.aptget import WOAptGet
from wo.core.shellexec import * from wo.core.shellexec import WOShellExec
from wo.core.mysql import WOMysql from wo.core.mysql import WOMysql
from wo.core.services import WOService from wo.core.services import WOService
from wo.core.logging import Log from wo.core.logging import Log
@@ -92,6 +92,7 @@ class WODebugController(CementBaseController):
debug_address = (self.app.config.get('stack', 'ip-address') debug_address = (self.app.config.get('stack', 'ip-address')
.split()) .split())
except Exception as e: except Exception as e:
Log.debug(self, "{0}".format(e))
debug_address = ['0.0.0.0/0'] debug_address = ['0.0.0.0/0']
# Check if IP address is 127.0.0.1 then enable debug globally # Check if IP address is 127.0.0.1 then enable debug globally
@@ -660,6 +661,7 @@ class WODebugController(CementBaseController):
try: try:
cron_time = int(self.app.pargs.interval) cron_time = int(self.app.pargs.interval)
except Exception as e: except Exception as e:
Log.debug(self, "{0}".format(e))
cron_time = 5 cron_time = 5
try: try:

View File

@@ -93,6 +93,7 @@ class WOInfoController(CementBaseController):
www_xdebug = (config['www']['php_admin_flag[xdebug.profiler_enable' www_xdebug = (config['www']['php_admin_flag[xdebug.profiler_enable'
'_trigger]']) '_trigger]'])
except Exception as e: except Exception as e:
Log.debug(self, "{0}".format(e))
www_xdebug = 'off' www_xdebug = 'off'
config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2")) config.read('/etc/{0}/fpm/pool.d/debug.conf'.format("php/7.2"))
@@ -111,6 +112,7 @@ class WOInfoController(CementBaseController):
debug_xdebug = (config['debug']['php_admin_flag[xdebug.profiler_' debug_xdebug = (config['debug']['php_admin_flag[xdebug.profiler_'
'enable_trigger]']) 'enable_trigger]'])
except Exception as e: except Exception as e:
Log.debug(self, "{0}".format(e))
debug_xdebug = 'off' debug_xdebug = 'off'
data = dict(version=version, expose_php=expose_php, data = dict(version=version, expose_php=expose_php,
@@ -168,6 +170,7 @@ class WOInfoController(CementBaseController):
www_xdebug = (config['www']['php_admin_flag[xdebug.profiler_enable' www_xdebug = (config['www']['php_admin_flag[xdebug.profiler_enable'
'_trigger]']) '_trigger]'])
except Exception as e: except Exception as e:
Log.debug(self, "{0}".format(e))
www_xdebug = 'off' www_xdebug = 'off'
config.read('/etc/php/7.3/fpm/pool.d/debug.conf') config.read('/etc/php/7.3/fpm/pool.d/debug.conf')
@@ -186,6 +189,7 @@ class WOInfoController(CementBaseController):
debug_xdebug = (config['debug']['php_admin_flag[xdebug.profiler_' debug_xdebug = (config['debug']['php_admin_flag[xdebug.profiler_'
'enable_trigger]']) 'enable_trigger]'])
except Exception as e: except Exception as e:
Log.debug(self, "{0}".format(e))
debug_xdebug = 'off' debug_xdebug = 'off'
data = dict(version=version, expose_php=expose_php, data = dict(version=version, expose_php=expose_php,

View File

@@ -97,7 +97,7 @@ class WOLogShowController(CementBaseController):
'/var/log/php5/fpm.log'] '/var/log/php5/fpm.log']
if self.app.pargs.mysql: if self.app.pargs.mysql:
# MySQL debug will not work for remote MySQL # MySQL debug will not work for remote MySQL
if WOVariables.wo_mysql_host is "localhost": if WOVariables.wo_mysql_host == "localhost":
if os.path.isfile('/var/log/mysql/mysql-slow.log'): if os.path.isfile('/var/log/mysql/mysql-slow.log'):
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
else: else:
@@ -236,7 +236,7 @@ class WOLogResetController(CementBaseController):
'/var/log/php5/fpm.log'] '/var/log/php5/fpm.log']
if self.app.pargs.mysql: if self.app.pargs.mysql:
# MySQL debug will not work for remote MySQL # MySQL debug will not work for remote MySQL
if WOVariables.wo_mysql_host is "localhost": if WOVariables.wo_mysql_host == "localhost":
if os.path.isfile('/var/log/mysql/mysql-slow.log'): if os.path.isfile('/var/log/mysql/mysql-slow.log'):
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
else: else:
@@ -364,7 +364,7 @@ class WOLogGzipController(CementBaseController):
'/var/log/php5/fpm.log'] '/var/log/php5/fpm.log']
if self.app.pargs.mysql: if self.app.pargs.mysql:
# MySQL debug will not work for remote MySQL # MySQL debug will not work for remote MySQL
if WOVariables.wo_mysql_host is "localhost": if WOVariables.wo_mysql_host == "localhost":
if os.path.isfile('/var/log/mysql/mysql-slow.log'): if os.path.isfile('/var/log/mysql/mysql-slow.log'):
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
else: else:
@@ -502,7 +502,7 @@ class WOLogMailController(CementBaseController):
'/var/log/php5/fpm.log'] '/var/log/php5/fpm.log']
if self.app.pargs.mysql: if self.app.pargs.mysql:
# MySQL debug will not work for remote MySQL # MySQL debug will not work for remote MySQL
if WOVariables.wo_mysql_host is "localhost": if WOVariables.wo_mysql_host == "localhost":
if os.path.isfile('/var/log/mysql/mysql-slow.log'): if os.path.isfile('/var/log/mysql/mysql-slow.log'):
self.msg = self.msg + ['/var/log/mysql/mysql-slow.log'] self.msg = self.msg + ['/var/log/mysql/mysql-slow.log']
else: else: