improve code quality according to codacy
This commit is contained in:
@@ -41,7 +41,7 @@ class WOInfoController(CementBaseController):
|
||||
@expose(hide=True)
|
||||
def info_nginx(self):
|
||||
"""Display Nginx information"""
|
||||
version = os.popen("nginx -v 2>&1 | awk -F '/' '{print $2}' | "
|
||||
version = os.popen("/usr/sbin/nginx -v 2>&1 | awk -F '/' '{print $2}' | "
|
||||
"awk -F ' ' '{print $1}' | tr '\n' ' '").read()
|
||||
allow = os.popen("grep ^allow /etc/nginx/common/acl.conf | "
|
||||
"cut -d' ' -f2 | cut -d';' -f1 | tr '\n' ' '").read()
|
||||
@@ -66,7 +66,7 @@ class WOInfoController(CementBaseController):
|
||||
@expose(hide=True)
|
||||
def info_php(self):
|
||||
"""Display PHP information"""
|
||||
version = os.popen("php7.2 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
|
||||
version = os.popen("/usr/bin/php7.2 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
|
||||
" cut -d'+' -f1 | tr -d '\n'").read
|
||||
config = configparser.ConfigParser()
|
||||
config.read('/etc/{0}/fpm/php.ini'.format("php/7.2"))
|
||||
@@ -140,7 +140,7 @@ class WOInfoController(CementBaseController):
|
||||
@expose(hide=True)
|
||||
def info_php73(self):
|
||||
"""Display PHP information"""
|
||||
version = os.popen("php7.3 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
|
||||
version = os.popen("/usr/bin/php7.3 -v 2>/dev/null | head -n1 | cut -d' ' -f2 |"
|
||||
" cut -d'+' -f1 | tr -d '\n'").read
|
||||
config = configparser.ConfigParser()
|
||||
config.read('/etc/php/7.3/fpm/php.ini')
|
||||
@@ -214,23 +214,23 @@ class WOInfoController(CementBaseController):
|
||||
@expose(hide=True)
|
||||
def info_mysql(self):
|
||||
"""Display MySQL information"""
|
||||
version = os.popen("mysql -V | awk '{print($5)}' | cut -d ',' "
|
||||
version = os.popen("/usr/bin/mysql -V | awk '{print($5)}' | cut -d ',' "
|
||||
"-f1 | tr -d '\n'").read()
|
||||
host = "localhost"
|
||||
port = os.popen("mysql -e \"show variables\" | grep ^port | awk "
|
||||
port = os.popen("/usr/bin/mysql -e \"show variables\" | grep ^port | awk "
|
||||
"'{print($2)}' | tr -d '\n'").read()
|
||||
wait_timeout = os.popen("mysql -e \"show variables\" | grep "
|
||||
wait_timeout = os.popen("/usr/bin/mysql -e \"show variables\" | grep "
|
||||
"^wait_timeout | awk '{print($2)}' | "
|
||||
"tr -d '\n'").read()
|
||||
interactive_timeout = os.popen("mysql -e \"show variables\" | grep "
|
||||
interactive_timeout = os.popen("/usr/bin/mysql -e \"show variables\" | grep "
|
||||
"^interactive_timeout | awk "
|
||||
"'{print($2)}' | tr -d '\n'").read()
|
||||
max_used_connections = os.popen("mysql -e \"show global status\" | "
|
||||
max_used_connections = os.popen("/usr/bin/mysql -e \"show global status\" | "
|
||||
"grep Max_used_connections | awk "
|
||||
"'{print($2)}' | tr -d '\n'").read()
|
||||
datadir = os.popen("mysql -e \"show variables\" | grep datadir | awk"
|
||||
datadir = os.popen("/usr/bin/mysql -e \"show variables\" | grep datadir | awk"
|
||||
" '{print($2)}' | tr -d '\n'").read()
|
||||
socket = os.popen("mysql -e \"show variables\" | grep \"^socket\" | "
|
||||
socket = os.popen("/usr/bin/mysql -e \"show variables\" | grep \"^socket\" | "
|
||||
"awk '{print($2)}' | tr -d '\n'").read()
|
||||
data = dict(version=version, host=host, port=port,
|
||||
wait_timeout=wait_timeout,
|
||||
|
||||
@@ -16,7 +16,6 @@ from wo.core.git import WOGit
|
||||
from wo.core.checkfqdn import check_fqdn
|
||||
from pynginxconfig import NginxConfig
|
||||
from wo.core.services import WOService
|
||||
from wo.core.variables import WOVariables
|
||||
import random
|
||||
import string
|
||||
import configparser
|
||||
|
||||
Reference in New Issue
Block a user