]> git.decadent.org.uk Git - dak.git/blobdiff - dak/dakdb/update22.py
Convert exception handling to Python3 syntax.
[dak.git] / dak / dakdb / update22.py
index 4f95262debd1f72d2dceed90ab63225de828604a..81f20037ee0f674dc91ee37d155a9789ecf37a7b 100755 (executable)
@@ -69,7 +69,7 @@ def do_update(self):
 
         for q in c.fetchall():
             queues[q[0]] = q[1]
-            if q[1] in ['accepted', 'buildd']:
+            if q[1] in ['accepted', 'buildd', 'embargoed', 'unembargoed']:
                 # Move to build_queue_table
                 c.execute("""INSERT INTO build_queue (queue_name, path, copy_files)
                                    VALUES ('%s', '%s', '%s')""" % (q[1], q[2], q[3]))
@@ -98,7 +98,7 @@ def do_update(self):
                        ON DELETE CASCADE""")
 
 
-        c.execute("""ALTER TABLE suite DROP CONSTRAINT suite_policy_queue_fkey""")
+        c.execute("""ALTER TABLE suite DROP CONSTRAINT suite_policy_queue_id_fkey""")
 
         c.execute("""UPDATE suite
     SET policy_queue_id = (SELECT policy_queue.id FROM policy_queue
@@ -235,6 +235,6 @@ def do_update(self):
         c.execute("UPDATE config SET value = '22' WHERE name = 'db_revision'")
         self.db.commit()
 
-    except psycopg2.InternalError, msg:
+    except psycopg2.InternalError as msg:
         self.db.rollback()
         raise DBUpdateError, "Unable to apply queue_build 21, rollback issued. Error message : %s" % (str(msg))