[Update] 默认开启定时检测,运行失败默认log为warn

pull/1068/head
ibuler 2018-03-14 12:17:48 +08:00
parent 2e8f5919a8
commit 8b63961d4d
2 changed files with 2 additions and 2 deletions

View File

@ -21,7 +21,7 @@ TIMEOUT = 60
logger = get_logger(__file__)
CACHE_MAX_TIME = 60*60*60
disk_pattern = re.compile(r'^hd|sd|xvd|vd')
PERIOD_TASK = os.environ.get("PERIOD_TASK", "off")
PERIOD_TASK = os.environ.get("PERIOD_TASK", "on")
@shared_task

View File

@ -234,7 +234,7 @@ class AdHoc(models.Model):
result = runner.run(self.tasks, self.pattern, self.task.name)
return result.results_raw, result.results_summary
except AnsibleError as e:
logger.error("Failed run adhoc {}, {}".format(self.task.name, e))
logger.warn("Failed run adhoc {}, {}".format(self.task.name, e))
pass
@become.setter