Fix small issues detected by codacy
This commit is contained in:
@@ -14,7 +14,7 @@ from wo.core.fileutils import WOFileUtils
|
|||||||
from wo.core.logging import Log
|
from wo.core.logging import Log
|
||||||
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.shellexec import WOShellExec
|
from wo.core.shellexec import WOShellExec, CommandExecutionError
|
||||||
from wo.core.variables import WOVar
|
from wo.core.variables import WOVar
|
||||||
|
|
||||||
|
|
||||||
@@ -703,8 +703,7 @@ class WODebugController(CementBaseController):
|
|||||||
"-l | sed '/WordOps "
|
"-l | sed '/WordOps "
|
||||||
"start MySQL slow "
|
"start MySQL slow "
|
||||||
"log/,+2d'"
|
"log/,+2d'"
|
||||||
"| crontab -\""
|
"| crontab -\""):
|
||||||
.format(cron_time)):
|
|
||||||
Log.error(self, "failed to remove crontab entry")
|
Log.error(self, "failed to remove crontab entry")
|
||||||
except CommandExecutionError as e:
|
except CommandExecutionError as e:
|
||||||
Log.debug(self, str(e))
|
Log.debug(self, str(e))
|
||||||
|
|||||||
@@ -227,8 +227,7 @@ class WOSiteController(CementBaseController):
|
|||||||
Log.info(self, Log.ENDC + text)
|
Log.info(self, Log.ENDC + text)
|
||||||
f.close()
|
f.close()
|
||||||
else:
|
else:
|
||||||
Log.error(self, "nginx configuration file does not exists"
|
Log.error(self, "nginx configuration file does not exists")
|
||||||
.format(wo_domain))
|
|
||||||
|
|
||||||
@expose(help="Change directory to site webroot")
|
@expose(help="Change directory to site webroot")
|
||||||
def cd(self):
|
def cd(self):
|
||||||
|
|||||||
@@ -148,9 +148,8 @@ class WOAcme:
|
|||||||
self, "You have to set the "
|
self, "You have to set the "
|
||||||
"proper DNS record for your domain", False)
|
"proper DNS record for your domain", False)
|
||||||
return False
|
return False
|
||||||
else:
|
Log.debug(self, "DNS record are properly set")
|
||||||
Log.debug(self, "DNS record are properly set")
|
return True
|
||||||
return True
|
|
||||||
|
|
||||||
def cert_check(self, wo_domain_name):
|
def cert_check(self, wo_domain_name):
|
||||||
"""Check certificate existance with acme.sh and return Boolean"""
|
"""Check certificate existance with acme.sh and return Boolean"""
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
class WODomain():
|
class WODomain:
|
||||||
"""WordOps domain validation utilities"""
|
"""WordOps domain validation utilities"""
|
||||||
|
|
||||||
def validate(self, url):
|
def validate(self, url):
|
||||||
@@ -24,7 +24,6 @@ class WODomain():
|
|||||||
return final_domain
|
return final_domain
|
||||||
return domain_name
|
return domain_name
|
||||||
|
|
||||||
|
|
||||||
def getlevel(self, domain):
|
def getlevel(self, domain):
|
||||||
"""
|
"""
|
||||||
Returns the domain type : domain, subdomain and the root domain
|
Returns the domain type : domain, subdomain and the root domain
|
||||||
|
|||||||
Reference in New Issue
Block a user