fixed returnType of host.getServiceByName
This commit is contained in:
parent
a0c4613820
commit
ff03f51d6e
2 changed files with 7 additions and 4 deletions
|
|
@ -12,7 +12,7 @@ class Host:
|
|||
def getHostServiceByName(self, serviceName):
|
||||
for hostService in self.services:
|
||||
if serviceName == hostService.service.name:
|
||||
return hostService.service
|
||||
return hostService
|
||||
return None
|
||||
|
||||
def __str__(self):
|
||||
|
|
@ -39,7 +39,8 @@ class HostService:
|
|||
return self.service.command
|
||||
|
||||
def __str__(self):
|
||||
ret = str(self.service)
|
||||
|
||||
ret = "HostService : " + str(self.service)
|
||||
if self.warning:
|
||||
ret += "warning: " + str(self.warning)
|
||||
if self.critical:
|
||||
|
|
@ -103,7 +104,7 @@ def parseHostList(hosts, services, log):
|
|||
replacements.remove('host')
|
||||
#replacements should be empty now.
|
||||
#If not we cannot use this command as some values are missing
|
||||
if replacements:
|
||||
if len(replacements) > 0:
|
||||
log.w("Hostservice " + servicename + " from host " + host.name + " is ignored because of missing replacements: " + str(
|
||||
replacements))
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -41,7 +41,9 @@ class JobInfo:
|
|||
|
||||
def handleCall(self):
|
||||
self.log.d("handle call")
|
||||
self.log.d([str(s) for s in self.hostServices])
|
||||
self.log.d(self.hostServices)
|
||||
for hs in self.hostServices:
|
||||
log.d(str(hs))
|
||||
|
||||
|
||||
#must find real service command stored in hosts...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue