Few code quality improvements

This commit is contained in:
VirtuBox
2019-07-29 02:32:53 +02:00
parent 17510fe57c
commit b85a81ad8d
5 changed files with 20 additions and 25 deletions

View File

@@ -13,6 +13,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- MySQL configuration tuning
- Cronjob to optimize MySQL databases weekly
- WO-kernel systemd service to automatically apply kernel tweaks on server startup
- Brotli configuration with only well compressible MIME types
#### Changed

View File

@@ -753,7 +753,7 @@ class WODebugController(CementBaseController):
self.debug_fpm73()
if self.app.pargs.mysql:
# MySQL debug will not work for remote MySQL
if WOVariables.wo_mysql_host is "localhost":
if WOVariables.wo_mysql_host == "localhost":
self.debug_mysql()
else:
Log.warn(self, "Remote MySQL found, WordOps does not support "

View File

@@ -1,9 +1,6 @@
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from wo.core.shellexec import WOShellExec
from wo.core.logging import Log
from wo.core.variables import WOVariables
import os
def wo_import_slow_log_hook(app):

View File

@@ -2,7 +2,6 @@
from cement.core.controller import CementBaseController, expose
from cement.core import handler, hook
from wo.core.variables import WOVariables
from pynginxconfig import NginxConfig
from wo.core.aptget import WOAptGet
from wo.core.shellexec import WOShellExec
@@ -279,7 +278,7 @@ class WOInfoController(CementBaseController):
Log.error(self, "PHP 7.3 is not installed")
if self.app.pargs.mysql:
if WOShellExec.cmd_exec(self, "mysqladmin ping"):
if WOShellExec.cmd_exec(self, "/usr/bin/mysqladmin ping"):
self.info_mysql()
else:
Log.error(self, "MySQL is not installed")

View File

@@ -1,25 +1,23 @@
from wo.cli.plugins.stack import WOStackController
from wo.core.fileutils import WOFileUtils
from wo.core.mysql import *
from wo.core.shellexec import WOShellExec, CommandExecutionError
from wo.core.sslutils import SSL
from wo.core.variables import WOVariables
from wo.cli.plugins.sitedb import *
from wo.core.aptget import WOAptGet
from wo.core.git import WOGit
from wo.core.logging import Log
from wo.core.sendmail import WOSendMail
from wo.core.services import WOService
import subprocess
from subprocess import CalledProcessError
import os
import random
import string
import sys
import getpass
import glob
import os
import random
import re
import platform
import string
import subprocess
from subprocess import CalledProcessError
from wo.cli.plugins.sitedb import *
from wo.cli.plugins.stack import WOStackController
from wo.core.aptget import WOAptGet
from wo.core.fileutils import WOFileUtils
from wo.core.git import WOGit
from wo.core.logging import Log
from wo.core.mysql import *
from wo.core.services import WOService
from wo.core.shellexec import CommandExecutionError, WOShellExec
from wo.core.sslutils import SSL
from wo.core.variables import WOVariables
class SiteError(Exception):