added pointer for hostgroup in service
This commit is contained in:
parent
3bff0302a7
commit
dd984fedae
4 changed files with 15 additions and 1 deletions
|
|
@ -251,4 +251,8 @@ class FullConfigParser(ConfigParser):
|
|||
id_get_func = lambda hostgroup: hostgroup.get_name()
|
||||
self.replace_pointer(layouts, hostgroups, id_list_func, id_get_func)
|
||||
|
||||
for hg in hostgroups:
|
||||
for service in hg.get_services():
|
||||
service.set_hostgroup(hg)
|
||||
|
||||
return layouts
|
||||
|
|
@ -4,6 +4,10 @@ class Service:
|
|||
self.command = command
|
||||
self.comment = comment
|
||||
self.parser = parser
|
||||
self.hostgroup = None
|
||||
|
||||
def set_hostgroup(self, hostgroup):
|
||||
self.hostgroup = hostgroup
|
||||
|
||||
def __str__(self):
|
||||
return "Service('Name: " + self.name + "', 'Command: " + self.command + ", 'Parser: " + self.parser + "')"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue