parsing is finally done!
This commit is contained in:
parent
cc0d577b81
commit
323f859a64
3 changed files with 7 additions and 4 deletions
|
|
@ -66,4 +66,7 @@ class DatePeriod(Period):
|
|||
return ret
|
||||
|
||||
def createJob(self, scheduler, jobInfo, func):
|
||||
return scheduler.add_date_job(func, self.date, jobInfo)
|
||||
try:
|
||||
return scheduler.add_date_job(func=func, date=self.date, args=[jobInfo])
|
||||
except Exception, e:
|
||||
return None
|
||||
|
|
@ -59,7 +59,7 @@ def main():
|
|||
|
||||
scheduler = Scheduler()
|
||||
|
||||
|
||||
scheduler.start()
|
||||
jobs = []
|
||||
for layout in layouts:
|
||||
if layout.is_enabled():
|
||||
|
|
@ -67,7 +67,7 @@ def main():
|
|||
for service in hostgroup.get_services():
|
||||
for period in service.get_periods():
|
||||
jobs.append(period.createJob(scheduler, service, handleJob))
|
||||
scheduler.start()
|
||||
|
||||
|
||||
#log.i("starting linspector: reading config... (" + args.config + ")")
|
||||
#config_parser = ConfigParser(log)
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
"periods": {
|
||||
"doh": {"seconds": 10, "comment": "OMG, this means work"},
|
||||
"moes_time": {"minute":"0", "hour": "12", "day_of_week": "4", "comment": "much better"},
|
||||
"marges_birthday": { "date": "1965-2-24 04:00:00"}
|
||||
"marges_birthday": { "date": "2017-2-24 04:00:00"}
|
||||
},
|
||||
"hostgroups":{
|
||||
"power_plant":{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue