#!/usr/bin/env python
-# Debian Archive Kit Database Update Script
-# Copyright (C) 2008 Michael Casadevall <mcasadevall@debian.org>
+"""
+Saner DM db schema
+
+@contact: Debian FTP Master <ftpmaster@debian.org>
+@copyright: 2008 Michael Casadevall <mcasadevall@debian.org>
+@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
################################################################################
-import psycopg2, time
+import psycopg2
+import time
+from daklib.dak_exceptions import DBUpdateError
################################################################################
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)))