aboutsummaryrefslogtreecommitdiff
path: root/jobs
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordberg.se>2022-07-22 07:38:37 +0200
committerLinus Nordberg <linus@nordberg.se>2022-07-22 07:42:49 +0200
commit27edd463b00f2f37a36f93eda62b2c6d8b0ca9a3 (patch)
treeb5412e36f7576891618dcd2ca6c985e56f133753 /jobs
parent170dd84e7fe84ba0d364d5a6277454fa3de61bb6 (diff)
Allow for both list and string in sendEmail() to=sigsum
Diffstat (limited to 'jobs')
-rwxr-xr-xjobs/JobBase.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/jobs/JobBase.py b/jobs/JobBase.py
index 8763126..4d01ac6 100755
--- a/jobs/JobBase.py
+++ b/jobs/JobBase.py
@@ -143,7 +143,7 @@ class JobBase(object):
log.warn(self.getName() + " did not override onStateChangeSuccess")
return True
-def sendEmail(config, subject, body, to=""):
+def sendEmail(config, subject, body, to=None):
if config.getboolean('email', 'nomail'):
logging.info("Not sending email with subject '" + subject + '" but pretending we did.\n' + body)
return True
@@ -154,6 +154,8 @@ def sendEmail(config, subject, body, to=""):
if not to:
to = config.get('general', 'alertcontact')
+ if not isinstance(to, list):
+ to = [to]
# Prepare actual message
# Avoid gmail threading