more eye candy in lish output of job details

This commit is contained in:
Johannes Findeisen 2013-10-19 20:47:19 +02:00
commit 49bf87f254
2 changed files with 12 additions and 7 deletions

View file

@ -63,8 +63,8 @@ class Job:
self.log = log self.log = log
def pretty_string(self): def pretty_string(self):
ret = (self.hex_string() + ": (Hostgroup: " + str(self.hostgroup.get_name()) + ret = (self.hex_string() + ": Hostgroup: " + str(self.hostgroup.get_name()) +
" Host: " + str(self.host) + " Service: " + str(self.service) + " " + str(self.job) + ") Enabled: " + " Host: " + str(self.host) + " Service: " + str(self.service) + " " + str(self.job) + " Enabled: " +
str(self._enabled)) str(self._enabled))
return ret return ret
@ -74,7 +74,6 @@ class Job:
def set_enabled(self, enabled=True): def set_enabled(self, enabled=True):
self._enabled = enabled self._enabled = enabled
def handle_threshold(self, jobInfo, serviceThreshold, executionSucessful): def handle_threshold(self, jobInfo, serviceThreshold, executionSucessful):
if executionSucessful: if executionSucessful:
if self.jobThreshold > 0: if self.jobThreshold > 0:

View file

@ -181,10 +181,16 @@ class LishCommander(Exit, ShellCommander, LogCommander):
print "executes python using 'exec'." print "executes python using 'exec'."
def print_jobs_infos(self, job): def print_jobs_infos(self, job):
print "Job: " + job.hex_string() + "\n" + \ #TODO: fix the output for "interval" and "next run"
"Host: " + job.host + "\n" + \ print "Job:\t\t" + job.hex_string() + "\n" + \
"Service: " + job.service.get_type() + "\n" + \ "Hostgroup:\t" + job.hostgroup.get_name() + "\n" + \
"Members: " + str([member.name for member in job.members]) "Host:\t\t" + job.host + "\n" + \
"Service:\t" + str(job.service) + "\n" + \
"Members:\t" + str([member.name for member in job.members]) + "\n" + \
"Interval:\t" + str(job.job) + "\n" + \
"Next run:\t" + str(job.job) + "\n" + \
"Enabled:\t" + str(job._enabled) + "\n" + \
"Fails:\t\t" + str(job.jobThreshold)
def do_job(self, text): def do_job(self, text):
text = shsplit(text) text = shsplit(text)