diff options
author | Linus Nordberg <linus@nordberg.se> | 2022-07-22 07:38:37 +0200 |
---|---|---|
committer | Linus Nordberg <linus@nordberg.se> | 2022-07-22 07:42:49 +0200 |
commit | 27edd463b00f2f37a36f93eda62b2c6d8b0ca9a3 (patch) | |
tree | b5412e36f7576891618dcd2ca6c985e56f133753 /jobs | |
parent | 170dd84e7fe84ba0d364d5a6277454fa3de61bb6 (diff) |
Allow for both list and string in sendEmail() to=sigsum
Diffstat (limited to 'jobs')
-rwxr-xr-x | jobs/JobBase.py | 4 |
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 |