diff options
author | Tom Ritter <tom@ritter.vg> | 2016-01-31 14:56:27 -0500 |
---|---|---|
committer | Tom Ritter <tom@ritter.vg> | 2016-01-31 14:56:27 -0500 |
commit | e7c15ef06e7886f69cee15863d7f75dc75c9ecec (patch) | |
tree | a0c8a89062e62d61db24c025e51e3dfe731c2660 /jobs/JobBase.py | |
parent | 618c3606a1f5f230124a937201e53589dbab1260 (diff) |
Get custom state names for each of the jobs now
Diffstat (limited to 'jobs/JobBase.py')
-rwxr-xr-x | jobs/JobBase.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/jobs/JobBase.py b/jobs/JobBase.py index 29ca443..416f28d 100755 --- a/jobs/JobBase.py +++ b/jobs/JobBase.py @@ -2,6 +2,7 @@ import time import random +import hashlib import logging import datetime @@ -21,8 +22,9 @@ class JobFailureNotificationFrequency: ONSTATECHANGE = "state_change" class JobBase: - def __init__(self, config): + def __init__(self, config, *args): self.config = config + self.stateName = hashlib.sha1(self.getName() + "|" + "|".join(args)).hexdigest() """ Return a friendly name to identify this Job""" def getName(self): @@ -32,7 +34,7 @@ class JobBase: Needed to keep track of the job's run history. Takes into account the contructor arguments to uniquely identify JobSpawner-jobs""" def getStateName(self): - return self.getName() + return self.stateName """Returns True if the job should execute this cron-run""" def shouldExecute(self, cronmode): |