X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=dak%2Fdakdb%2Fupdate21.py;h=41cef6dc8c47d70093aa7af54a1e73b08cc887ec;hb=6b3c8ccbd61325e2b833ed252b5545a190bff92f;hp=8e36883f9eb7b4cdf9bfc80a322d9044fec64346;hpb=6d0c1b149473118c7efa7384a9f41fdf1428ffaf;p=dak.git diff --git a/dak/dakdb/update21.py b/dak/dakdb/update21.py index 8e36883f..41cef6dc 100755 --- a/dak/dakdb/update21.py +++ b/dak/dakdb/update21.py @@ -74,7 +74,7 @@ def do_update(self): f = c.fetchone() c.execute("""INSERT INTO queue_files (queueid, lastused, filename, fileid) VALUES (%s, now(), %s, %s)""", (queue, filename[filename.rindex('/')+1:], f[0])) - except OSError, e: + except OSError as e: print "Can't find file %s (%s)" % (filename, e) print "Dropping old queue_build table" @@ -115,7 +115,7 @@ def do_update(self): cnf = Config() c.execute("""INSERT INTO queue (queue_name, path) VALUES ('buildd', '%s')""" % cnf["Dir::QueueBuild"].rstrip('/')) - for s in cnf.ValueList("Dinstall::QueueBuildSuites"): + for s in cnf.value_list("Dinstall::QueueBuildSuites"): c.execute("""INSERT INTO suite_queue_copy (suite, queue) VALUES ( (SELECT id FROM suite WHERE suite_name = '%s'), (SELECT id FROM queue WHERE queue_name = 'buildd'))""" % s.lower()) @@ -124,6 +124,6 @@ def do_update(self): c.execute("UPDATE config SET value = '21' 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)) + raise DBUpdateError("Unable to apply queue_build 21, rollback issued. Error message : %s" % (str(msg)))