added job enable/disble stuff
This commit is contained in:
parent
1e04d58e5a
commit
e12e05dbc7
1 changed files with 17 additions and 9 deletions
|
|
@ -41,6 +41,7 @@ class Job:
|
||||||
self.hostgroup = hostgroup
|
self.hostgroup = hostgroup
|
||||||
self.jobInfos = []
|
self.jobInfos = []
|
||||||
self.jobThreshold = 0
|
self.jobThreshold = 0
|
||||||
|
self._enabled = True
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return str(self.__dict__)
|
return str(self.__dict__)
|
||||||
|
|
@ -89,6 +90,7 @@ class Job:
|
||||||
def handle_call(self):
|
def handle_call(self):
|
||||||
self.log.debug("handle call")
|
self.log.debug("handle call")
|
||||||
self.log.debug(self.service)
|
self.log.debug(self.service)
|
||||||
|
if self._enabled:
|
||||||
try:
|
try:
|
||||||
jobInfo = JobInfo(self.hex_string(), self.host, self.service)
|
jobInfo = JobInfo(self.hex_string(), self.host, self.service)
|
||||||
self.service._execute(jobInfo)
|
self.service._execute(jobInfo)
|
||||||
|
|
@ -103,6 +105,12 @@ class Job:
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
self.log.debug(e)
|
self.log.debug(e)
|
||||||
|
|
||||||
|
def enable(self):
|
||||||
|
self._enabled = True
|
||||||
|
|
||||||
|
def disable(self):
|
||||||
|
self._enabled = False
|
||||||
|
|
||||||
|
|
||||||
class JobInfo(object):
|
class JobInfo(object):
|
||||||
def __init__(self, jobHex, host, service):
|
def __init__(self, jobHex, host, service):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue