housekeeping and cleanups...
This commit is contained in:
parent
846be462d4
commit
63c4b4aa98
5 changed files with 23 additions and 33 deletions
|
|
@ -52,7 +52,7 @@ def parseHostGroupList(hostgroups, hosts, members, periods, services, log):
|
|||
if service is not None:
|
||||
services.append(service)
|
||||
else:
|
||||
log.w("could not find HostService(" +str(serviceName) + ") for host " + host.name)
|
||||
log.w("could not find HostService(" + str(serviceName) + ") for host " + host.name)
|
||||
hostGroupPeriods = [p for p in periods if p.name in servicePeriods]
|
||||
hostGroup.services.append(HostGroupService(services, hostGroupPeriods))
|
||||
parsedHostGroups.append(hostGroup)
|
||||
|
|
|
|||
|
|
@ -45,12 +45,12 @@ class HostService:
|
|||
ret += "warning: " + str(self.warning)
|
||||
if self.critical:
|
||||
ret += "critical: " + str(self.critical)
|
||||
return ret;
|
||||
return ret
|
||||
|
||||
|
||||
def parseHostList(hosts, services, log):
|
||||
"""
|
||||
parse the HostList and replace any command as nessesary
|
||||
parse the HostList and replace any command as necessary
|
||||
"""
|
||||
#precompiled regexPattern which finds replacements in service strings
|
||||
pattern = re.compile("@(\w+)")
|
||||
|
|
@ -97,7 +97,7 @@ def parseHostList(hosts, services, log):
|
|||
#host will not be inside ServiceParameters, so check this also
|
||||
if 'host' in replacements:
|
||||
log.d("replacing host in " + hostService.getCommand())
|
||||
comm= re.sub('@host', host.host, hostService.getCommand())
|
||||
comm = re.sub('@host', host.host, hostService.getCommand())
|
||||
hostService.setCommand(comm)
|
||||
log.d("new Command: " +comm)
|
||||
log.d("set in hostService: " + str(hostService))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue