Fix some errors with pylint
This commit is contained in:
@@ -1051,6 +1051,7 @@ class WOSiteUpdateController(CementBaseController):
|
||||
if not WOService.reload_service(self, 'nginx'):
|
||||
Log.error(self, "service nginx reload failed. "
|
||||
"check issues with `nginx -t` command")
|
||||
return 0
|
||||
|
||||
if (pargs.ngxblocker and not (pargs.html or
|
||||
pargs.php or pargs.php73 or
|
||||
@@ -1060,11 +1061,14 @@ class WOSiteUpdateController(CementBaseController):
|
||||
pargs.wpsubdir or pargs.wpsubdomain or
|
||||
pargs.hsts)):
|
||||
if pargs.ngxblocker == "on":
|
||||
try:
|
||||
setupngxblocker(self, wo_domain)
|
||||
except SiteError as e:
|
||||
Log.debug(self, str(e))
|
||||
Log.info(self, "\nngxblocker not enabled.")
|
||||
if os.path.isdir('/etc/nginx/bots.d'):
|
||||
try:
|
||||
setupngxblocker(self, wo_domain)
|
||||
except SiteError as e:
|
||||
Log.debug(self, str(e))
|
||||
Log.info(self, "\nngxblocker not enabled.")
|
||||
else:
|
||||
Log.error(self, 'ngxblocker stack is not installed')
|
||||
elif pargs.ngxblocker == "off":
|
||||
if os.path.isfile(
|
||||
'/var/www/{0}/conf/nginx/ngxblocker.conf'
|
||||
@@ -1082,6 +1086,7 @@ class WOSiteUpdateController(CementBaseController):
|
||||
if not WOService.reload_service(self, 'nginx'):
|
||||
Log.error(self, "service nginx reload failed. "
|
||||
"check issues with `nginx -t` command")
|
||||
return 0
|
||||
|
||||
if ((stype == 'php' and
|
||||
oldsitetype not in ['html', 'proxy', 'php73']) or
|
||||
|
||||
@@ -17,7 +17,8 @@ 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 WOMysql
|
||||
from wo.core.mysql import (MySQLConnectionError, StatementExcecutionError,
|
||||
WOMysql)
|
||||
from wo.core.services import WOService
|
||||
from wo.core.shellexec import CommandExecutionError, WOShellExec
|
||||
from wo.core.sslutils import SSL
|
||||
@@ -1622,4 +1623,4 @@ def setupngxblocker(self, domain, block=True):
|
||||
self, '/var/www/{0}/conf/nginx/ngxblocker.disabled'
|
||||
.format(domain), '/var/www/{0}/conf/nginx/ngxblocker'
|
||||
.format(domain))
|
||||
return 0
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user