aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ritter <tom@ritter.vg>2016-01-31 17:20:05 -0500
committerTom Ritter <tom@ritter.vg>2016-01-31 17:36:13 -0500
commit2fe68bac48427e687888fb8de13eea541d531610 (patch)
tree8f201b06840131b0ccfa1831f59bd1ac35471922
parente7c15ef06e7886f69cee15863d7f75dc75c9ecec (diff)
Fix the super() calling
-rwxr-xr-xjobmanager.py2
-rwxr-xr-xjobs/HTTPServerChecker.py2
-rwxr-xr-xjobs/JobBase.py4
-rwxr-xr-xjobs/PeerChecker.py2
-rwxr-xr-xjobs/TCPServerChecker.py2
5 files changed, 6 insertions, 6 deletions
diff --git a/jobmanager.py b/jobmanager.py
index 9bfb2d3..9519379 100755
--- a/jobmanager.py
+++ b/jobmanager.py
@@ -43,6 +43,7 @@ class JobManager:
emailWorks = True
for thisJob in self.jobs:
if thisJob.shouldExecute(cronmode):
+ logging.info("Executing " + thisJob.getName() + "(" + thisJob.getStateName() + ")")
try:
lastRunStatus = self.state[thisJob.getStateName()]
except:
@@ -50,7 +51,6 @@ class JobManager:
", making up a dummy state for it.")
lastRunStatus = self.state[thisJob.getStateName()] = JobState.Empty(thisJob.getStateName())
- logging.info("Executing " + thisJob.getName() + "(" + thisJob.getStateName() + ")")
if not thisJob.execute():
#Unsuccessful run
logging.info("Execution of " + thisJob.getName() + " failed")
diff --git a/jobs/HTTPServerChecker.py b/jobs/HTTPServerChecker.py
index 965e977..e590486 100755
--- a/jobs/HTTPServerChecker.py
+++ b/jobs/HTTPServerChecker.py
@@ -14,11 +14,11 @@ class HTTPServerChecker(JobSpawner.JobSpawner):
class ServerChecker(JobBase.JobBase):
def __init__(self, config, url, frequency, failureNotificationFrequency):
- JobBase.JobBase.__init__(self, config, url, frequency, failureNotificationFrequency)
self.config = config
self.url = url
self.frequency = frequency
self.failureNotificationFrequency = failureNotificationFrequency
+ super(HTTPServerChecker.ServerChecker, self).__init__(config, url, frequency, failureNotificationFrequency)
def getName(self):
return str(self.__class__) + " for " + self.url
diff --git a/jobs/JobBase.py b/jobs/JobBase.py
index 416f28d..427dd17 100755
--- a/jobs/JobBase.py
+++ b/jobs/JobBase.py
@@ -21,10 +21,10 @@ class JobFailureNotificationFrequency:
EVERYHOUR = "hour"
ONSTATECHANGE = "state_change"
-class JobBase:
+class JobBase(object):
def __init__(self, config, *args):
self.config = config
- self.stateName = hashlib.sha1(self.getName() + "|" + "|".join(args)).hexdigest()
+ self.stateName = hashlib.sha1(self.getName() + "|" + "|".join([str(a) for a in args])).hexdigest()
""" Return a friendly name to identify this Job"""
def getName(self):
diff --git a/jobs/PeerChecker.py b/jobs/PeerChecker.py
index d271419..8d0a6b7 100755
--- a/jobs/PeerChecker.py
+++ b/jobs/PeerChecker.py
@@ -13,9 +13,9 @@ import JobSpawner
class PeerChecker(JobSpawner.JobSpawner):
class IndividualPeerChecker(JobBase.JobBase):
def __init__(self, config, checkurl, notificationAddress):
- JobBase.JobBase.__init__(self, config, checkurl, notificationAddress)
self.checkurl = checkurl
self.notificationAddress = notificationAddress
+ super(PeerChecker.IndividualPeerChecker, self).__init__(config, checkurl, notificationAddress)
def executeEvery(self):
return JobBase.JobFrequency.HOUR
diff --git a/jobs/TCPServerChecker.py b/jobs/TCPServerChecker.py
index bdb914c..eaf6704 100755
--- a/jobs/TCPServerChecker.py
+++ b/jobs/TCPServerChecker.py
@@ -14,13 +14,13 @@ class TCPServerChecker(JobSpawner.JobSpawner):
class ServerChecker(JobBase.JobBase):
def __init__(self, config, ip, port, friendlyName, frequency, failureNotificationFrequency):
- JobBase.JobBase.__init__(self, config, ip, port, friendlyName, frequency, failureNotificationFrequency)
self.config = config
self.ip = ip
self.port = port
self.friendlyName = friendlyName + "(" + self.ip + ":" + str(self.port) + ")"
self.frequency = frequency
self.failureNotificationFrequency = failureNotificationFrequency
+ super(TCPServerChecker.ServerChecker, self).__init__(config, ip, port, friendlyName, frequency, failureNotificationFrequency)
def getName(self):
return str(self.__class__) + " for " + self.friendlyName