test
This commit is contained in:
parent
a81c698489
commit
9fbd3ae607
2 changed files with 12 additions and 9 deletions
|
|
@ -225,6 +225,10 @@ class FullConfigParser(ConfigParser):
|
||||||
class_check = lambda processor: isinstance(processor, Processor)
|
class_check = lambda processor: isinstance(processor, Processor)
|
||||||
self.replace_with_import(self.hostgroups, MOD_PROCESSORS, items_func, class_check)
|
self.replace_with_import(self.hostgroups, MOD_PROCESSORS, items_func, class_check)
|
||||||
|
|
||||||
|
items_func = lambda member: member.get_tasks()
|
||||||
|
class_check = lambda task: isinstance(task, Task)
|
||||||
|
self.replace_with_import(members, MOD_TASKS, items_func, class_check)
|
||||||
|
|
||||||
services = []
|
services = []
|
||||||
for hg in self.hostgroups:
|
for hg in self.hostgroups:
|
||||||
services.extend(hg.get_services())
|
services.extend(hg.get_services())
|
||||||
|
|
@ -233,9 +237,7 @@ class FullConfigParser(ConfigParser):
|
||||||
class_check = lambda parser: isinstance(parser, Parser)
|
class_check = lambda parser: isinstance(parser, Parser)
|
||||||
self.replace_with_import(services, MOD_PARSERS, items_func, class_check)
|
self.replace_with_import(services, MOD_PARSERS, items_func, class_check)
|
||||||
|
|
||||||
items_func = lambda member: member.get_tasks()
|
|
||||||
class_check = lambda task: isinstance(task, Task)
|
|
||||||
self.replace_with_import(members, MOD_TASKS, items_func, class_check)
|
|
||||||
|
|
||||||
#replace object pointer
|
#replace object pointer
|
||||||
id_list_func = lambda hostgroup: hostgroup.get_members()
|
id_list_func = lambda hostgroup: hostgroup.get_members()
|
||||||
|
|
|
||||||
13
minimal.json
13
minimal.json
|
|
@ -3,7 +3,8 @@
|
||||||
"homer":{
|
"homer":{
|
||||||
"name": "Homer Simpson",
|
"name": "Homer Simpson",
|
||||||
"comment": "Security Inspector",
|
"comment": "Security Inspector",
|
||||||
"tasks": [{"class":"email", "type": "donut", "args": {"rcpt": "homer_j_simpson@burnscorp.sp"}}]
|
"tasks": [{"class":"email", "type": "donut", "args": {"rcpt": "homer_j_simpson@burnscorp.sp"}},
|
||||||
|
{"class":"email", "type": "donut", "args": {"rcpt": "homer_j_simpson@burnscorp.sp"}}]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"periods": {
|
"periods": {
|
||||||
|
|
@ -22,14 +23,14 @@
|
||||||
{
|
{
|
||||||
"class": "ping",
|
"class": "ping",
|
||||||
"fails": {"donut": 2000},
|
"fails": {"donut": 2000},
|
||||||
"periods":["doh"],
|
"periods": ["doh"],
|
||||||
"threshold": 500
|
"threshold": 500
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"class": "ping",
|
"class": "ping",
|
||||||
"fails": {"donut": 2000},
|
"fails": {"donut": 2000},
|
||||||
"periods":["doh"],
|
"periods": ["doh"],
|
||||||
"threshold": 500
|
"threshold": 500
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"class": "tcpconnect",
|
"class": "tcpconnect",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue