mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
remove schedule import from servers
This commit is contained in:
parent
ef4a31d1e8
commit
210b831a47
@ -31,7 +31,6 @@ logger = logging.getLogger(__name__)
|
|||||||
try:
|
try:
|
||||||
import psutil
|
import psutil
|
||||||
#import pexpect
|
#import pexpect
|
||||||
import schedule
|
|
||||||
|
|
||||||
except ModuleNotFoundError as e:
|
except ModuleNotFoundError as e:
|
||||||
logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True)
|
logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True)
|
||||||
|
@ -11,6 +11,7 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import tempfile
|
import tempfile
|
||||||
import threading
|
import threading
|
||||||
|
from cron_validator import CronValidator
|
||||||
|
|
||||||
from tornado import locale
|
from tornado import locale
|
||||||
from tornado import iostream
|
from tornado import iostream
|
||||||
@ -991,9 +992,10 @@ class PanelHandler(BaseHandler):
|
|||||||
else:
|
else:
|
||||||
interval_type = ''
|
interval_type = ''
|
||||||
cron_string = bleach.clean(self.get_argument('cron', ''))
|
cron_string = bleach.clean(self.get_argument('cron', ''))
|
||||||
cron_split = cron_string.split(' ')
|
try:
|
||||||
if len(cron_split) != 5:
|
CronValidator.parse(cron_string)
|
||||||
self.redirect("/panel/error?error=INVALID FORMAT: Invalid Cron Format. Cron must have a space between each character and only have a max of 5 characters * * * * *")
|
except Exception as e:
|
||||||
|
self.redirect("/panel/error?error=INVALID FORMAT: Invalid Cron Format. {}".format(e))
|
||||||
return
|
return
|
||||||
action = bleach.clean(self.get_argument('action', None))
|
action = bleach.clean(self.get_argument('action', None))
|
||||||
if action == "command":
|
if action == "command":
|
||||||
|
Loading…
Reference in New Issue
Block a user