diff treepkg/packager.py @ 99:7888fe374e11

Add support for notification mails in case of build errors This involves a new status field notification_mail to keep track of whether a notification has been sent for a particular build attempt and two programs to list the pending notifications and to send the pending notifications (similar to how the static web pages are published) as well as the corresponding configuration files.
author Bernhard Herzog <bh@intevation.de>
date Tue, 19 Feb 2008 19:19:23 +0000
parents f7b9c7113c46
children 66cbfc772f84
line wrap: on
line diff
--- a/treepkg/packager.py	Mon Nov 26 15:17:04 2007 +0000
+++ b/treepkg/packager.py	Tue Feb 19 19:19:23 2008 +0000
@@ -1,4 +1,4 @@
-# Copyright (C) 2007 by Intevation GmbH
+# Copyright (C) 2007, 2008 by Intevation GmbH
 # Authors:
 # Bernhard Herzog <bh@intevation.de>
 #
@@ -264,6 +264,12 @@
         except:
             self.status.error()
             self.status.stop = datetime.datetime.utcnow()
+            # set the notification status last to avoid race conditions.
+            # The pending notification is for now the only situation
+            # where another process might modify the status file (the
+            # listpendingnotifications program will set it to
+            # "notification_sent")
+            self.status.notification_pending()
             raise
 
     def remove_package_dir(self):
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)