emails: more verbose subject line packaging tip

Thu, 05 Dec 2019 14:16:02 +0100

author
mdd
date
Thu, 05 Dec 2019 14:16:02 +0100
branch
packaging
changeset 67
87b9cfda5dcb
parent 66
393aa36f48d6

emails: more verbose subject line

victrond/victrond.py file | annotate | diff | comparison | revisions
--- a/victrond/victrond.py	Sun Mar 25 18:08:21 2018 +0200
+++ b/victrond/victrond.py	Thu Dec 05 14:16:02 2019 +0100
@@ -104,7 +104,8 @@
 Last Status duration without change: %s seconds""" % (old, new, duration)
         print msg
         # now send the mail...
-        mail_deliver(NOTICE_EMAIL, "Event detected", msg)
+        mail_deliver(NOTICE_EMAIL, "Event detected: %s" % (
+            get_event_text(event)), msg)
         self.last_event = self.event
         self.event_start = timestamp
 
@@ -252,12 +253,15 @@
         time.sleep(0.5)
         if self.query("vTr") == "1":
             ret += "<font color='green'>TEST SUCCESS</font>"
+            subject = "passed"
         else:
             ret += "<font color='red'>TEST FAILURE</font>"
+            subject = "FAILED"
 
         self.comm_free = True
 
-        mail_deliver(NOTICE_EMAIL, "Selftest completed", ret)
+        mail_deliver(NOTICE_EMAIL, "System Selftest %s" % (
+            subject), ret)
         return ret
 
     def _battery_test(self):
@@ -290,12 +294,15 @@
         time.sleep(0.5)
         if self.query("vTr") == "1":
             ret += "<font color='green'>TEST SUCCESS</font>"
+            subject = "passed"
         else:
             ret += "<font color='red'>TEST FAILURE</font>"
+            subject = "FAILED"
 
         self.comm_free = True
 
-        mail_deliver(NOTICE_EMAIL, "Selftest completed", ret)
+        mail_deliver(NOTICE_EMAIL, "Battery Selftest %s" % (
+            subject), ret)
 
         return ret
 

mercurial