From ff03f51d6eb022289f1ccac34c4cd9bc56f771fb Mon Sep 17 00:00:00 2001 From: "Rafael.Timmerberg" Date: Wed, 29 May 2013 23:16:51 +0200 Subject: [PATCH] fixed returnType of host.getServiceByName --- lib/config/hosts.py | 7 ++++--- lib/core/job.py | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/config/hosts.py b/lib/config/hosts.py index b3bb29a..a4eccdc 100644 --- a/lib/config/hosts.py +++ b/lib/config/hosts.py @@ -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: diff --git a/lib/core/job.py b/lib/core/job.py index bbaf58a..8cf684a 100644 --- a/lib/core/job.py +++ b/lib/core/job.py @@ -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...