Mercurial > treepkg > treepkg
comparison 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 |
comparison
equal
deleted
inserted
replaced
98:f7b9c7113c46 | 99:7888fe374e11 |
---|---|
1 # Copyright (C) 2007 by Intevation GmbH | 1 # Copyright (C) 2007, 2008 by Intevation GmbH |
2 # Authors: | 2 # Authors: |
3 # Bernhard Herzog <bh@intevation.de> | 3 # Bernhard Herzog <bh@intevation.de> |
4 # | 4 # |
5 # This program is free software under the GPL (>=v2) | 5 # This program is free software under the GPL (>=v2) |
6 # Read the file COPYING coming with the software for details. | 6 # Read the file COPYING coming with the software for details. |
262 bin_packager.package() | 262 bin_packager.package() |
263 self.status.stop = datetime.datetime.utcnow() | 263 self.status.stop = datetime.datetime.utcnow() |
264 except: | 264 except: |
265 self.status.error() | 265 self.status.error() |
266 self.status.stop = datetime.datetime.utcnow() | 266 self.status.stop = datetime.datetime.utcnow() |
267 # set the notification status last to avoid race conditions. | |
268 # The pending notification is for now the only situation | |
269 # where another process might modify the status file (the | |
270 # listpendingnotifications program will set it to | |
271 # "notification_sent") | |
272 self.status.notification_pending() | |
267 raise | 273 raise |
268 | 274 |
269 def remove_package_dir(self): | 275 def remove_package_dir(self): |
270 logging.info("Removing pkgdir %r", self.base_dir) | 276 logging.info("Removing pkgdir %r", self.base_dir) |
271 shutil.rmtree(self.base_dir) | 277 shutil.rmtree(self.base_dir) |