X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate2.py;h=850e3ab550a5b2c993604d96fe862bf9cf1a0dcd;hb=6535c08e0f7ee72ed81c5019d63d301401f9f873;hp=e411662c69fd50860c135173ceeda6cacb02c2c2;hpb=cd5b29ddfd8de263c085f494b9573d683913f6f3;p=dak.git diff --git a/dak/dakdb/update2.py b/dak/dakdb/update2.py index e411662c..850e3ab5 100755 --- a/dak/dakdb/update2.py +++ b/dak/dakdb/update2.py @@ -21,18 +21,18 @@ ################################################################################ -import psycopg2, time +import psycopg2 +import time +from daklib.dak_exceptions import DBUpdateError ################################################################################ def do_update(self): -vvvvvvvvvvvvvvvvvvvv print "Note: to be able to enable the the PL/Perl (plperl) procedural language, we do" print "need postgresql-plperl-$postgres-version installed. Make sure that this is the" print "case before you continue. Interrupt if it isn't, sleeping 5 seconds now." print "(We need to be database superuser for this to work!)" time.sleep (5) -^^^^^^^^^^^^^^^^^^^^ try: c = self.db.cursor() @@ -393,6 +393,4 @@ $$ except psycopg2.ProgrammingError, msg: self.db.rollback() - print "FATAL: Unable to apply debversion table update 2!" - print "Error Message: " + str(msg) - print "Database changes have been rolled back." + raise DBUpdateError, "Unable to appy debversion updates, rollback issued. Error message : %s" % (str(msg))