X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate1.py;h=21942765e560b056d167d3755e409fe73d5343c0;hb=5ae0dac7c89af97eab8ba4fb34e1099a3b9dddc7;hp=7778b1be7cfe41fbc9e5b9fc70262674885cd341;hpb=81d0c91b0d085b66aa40a9e147698f618b825d62;p=dak.git diff --git a/dak/dakdb/update1.py b/dak/dakdb/update1.py old mode 100755 new mode 100644 index 7778b1be..21942765 --- a/dak/dakdb/update1.py +++ b/dak/dakdb/update1.py @@ -1,7 +1,12 @@ #!/usr/bin/env python -""" Database Update Script - Saner DM db schema """ -# Copyright (C) 2008 Michael Casadevall +""" +Saner DM db schema + +@contact: Debian FTP Master +@copyright: 2008 Michael Casadevall +@license: GNU General Public License version 2 or later +""" # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -24,7 +29,9 @@ ################################################################################ -import psycopg2, time +import psycopg2 +import time +from daklib.dak_exceptions import DBUpdateError ################################################################################ @@ -57,8 +64,6 @@ def do_update(self): print "Pausing for five seconds ..." time.sleep (5) - except psycopg2.ProgrammingError, msg: + except psycopg2.ProgrammingError as msg: self.db.rollback() - print "FATAL: Unable to apply DM table update 1!" - print "Error Message: " + str(msg) - print "Database changes have been rolled back." + raise DBUpdateError("Unable to appy DM table updates, rollback issued. Error message : %s" % (str(msg)))