2013-05-16 23:03:00 +02:00
|
|
|
import json
|
2013-06-05 07:26:53 +02:00
|
|
|
from tasks import parseTaskList
|
2013-05-16 23:03:00 +02:00
|
|
|
from members import parseMemberList
|
2013-06-18 00:10:14 +02:00
|
|
|
|
2013-06-05 04:18:37 +02:00
|
|
|
#from hostgroups import parseHostGroupList
|
|
|
|
|
#from layouts import parseLayoutList
|
2013-05-16 23:03:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
class Config:
|
2013-05-24 02:50:10 +02:00
|
|
|
def __init__(self, configFile, log):
|
2013-05-16 23:03:00 +02:00
|
|
|
self.configfile = configFile
|
|
|
|
|
f = open(configFile)
|
|
|
|
|
self.config = f.read()
|
|
|
|
|
f.close()
|
|
|
|
|
|
|
|
|
|
self.dict = json.loads(self.config)
|
|
|
|
|
|
2013-06-05 07:26:53 +02:00
|
|
|
self.tasks = parseTaskList(self.dict['tasks'])
|
|
|
|
|
self.members = parseMemberList(self.dict['members'], self.tasks, log)
|
2013-06-18 00:10:14 +02:00
|
|
|
#self.periods = parsePeriodList(self.dict['periods'], log)
|
2013-06-05 04:18:37 +02:00
|
|
|
#self.hostgroups = parseHostGroupList(self.dict['hostgroups'],
|
|
|
|
|
# self.members,
|
|
|
|
|
# self.periods,
|
|
|
|
|
# log)
|
2013-05-16 23:03:00 +02:00
|
|
|
|
2013-05-27 03:54:04 +02:00
|
|
|
#self.layouts = LayoutList(self.dict['layouts'], self.hostgroups)
|