reformat code according to pep8
This commit is contained in:
@@ -7,8 +7,10 @@ Set CRON on LINUX system.
|
||||
|
||||
|
||||
class WOCron():
|
||||
def setcron_weekly(self, cmd, comment='Cron set by WordOps', user='root', min=0, hour=12):
|
||||
if not WOShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)):
|
||||
def setcron_weekly(self, cmd, comment='Cron set by WordOps', user='root',
|
||||
min=0, hour=12):
|
||||
if not WOShellExec.cmd_exec(self, "crontab -l "
|
||||
"| grep -q \'{0}\'".format(cmd)):
|
||||
|
||||
WOShellExec.cmd_exec(self, "/bin/bash -c \"crontab -l "
|
||||
"2> /dev/null | {{ cat; echo -e"
|
||||
@@ -20,7 +22,8 @@ class WOCron():
|
||||
Log.debug(self, "Cron set")
|
||||
|
||||
def remove_cron(self, cmd):
|
||||
if WOShellExec.cmd_exec(self, "crontab -l | grep -q \'{0}\'".format(cmd)):
|
||||
if WOShellExec.cmd_exec(self, "crontab -l "
|
||||
"| grep -q \'{0}\'".format(cmd)):
|
||||
if not WOShellExec.cmd_exec(self, "/bin/bash -c "
|
||||
"\"crontab "
|
||||
"-l | sed '/{0}/d'"
|
||||
|
||||
@@ -112,7 +112,7 @@ class WOMysql():
|
||||
" --single-transaction".format(dbs),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE, shell=True)
|
||||
p2 = subprocess.Popen("gzip -c > /var/wo-mysqlbackup/{0}{1}.s"
|
||||
p2 = subprocess.Popen("pigz -c > /var/wo-mysqlbackup/{0}{1}.s"
|
||||
"ql.gz".format(dbs, WOVariables.wo_date),
|
||||
stdin=p1.stdout,
|
||||
shell=True)
|
||||
|
||||
@@ -116,7 +116,8 @@ class WOService():
|
||||
try:
|
||||
is_exist = subprocess.getstatusoutput('which {0}'
|
||||
.format(service_name))
|
||||
if is_exist[0] == 0 or service_name in ['php7.2-fpm', 'php7.3-fpm']:
|
||||
if is_exist[0] == 0 or service_name in ['php7.2-fpm',
|
||||
'php7.3-fpm']:
|
||||
retcode = subprocess.getstatusoutput('service {0} status'
|
||||
.format(service_name))
|
||||
if retcode[0] == 0:
|
||||
|
||||
Reference in New Issue
Block a user