################################################################################
Cnf = None
-required_database_schema = 65
+required_database_schema = 97
################################################################################
self.db = psycopg2.connect(connect_str)
- except Exception, e:
+ except Exception as e:
print "FATAL: Failed connect to database (%s)" % str(e)
sys.exit(1)
message = "updated database schema from %d to %d" % (database_revision, i+1)
print message
logger.log([message])
- except DBUpdateError, e:
+ except DBUpdateError as e:
# Seems the update did not work.
print "Was unable to update database schema from %d to %d." % (database_revision, i+1)
print "The error message received was %s" % (e)
if not cnf.has_key("Update-DB::Options::%s" % (i)):
cnf["Update-DB::Options::%s" % (i)] = ""
- arguments = apt_pkg.ParseCommandLine(cnf.Cnf, arguments, sys.argv)
+ arguments = apt_pkg.parse_commandline(cnf.Cnf, arguments, sys.argv)
- options = cnf.SubTree("Update-DB::Options")
+ options = cnf.subtree("Update-DB::Options")
if options["Help"]:
self.usage()
elif arguments:
fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
else:
utils.warn("Lock directory doesn't exist yet - not locking")
- except IOError, e:
+ except IOError as e:
if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EAGAIN':
utils.fubar("Couldn't obtain lock; assuming another 'dak process-unchecked' is already running.")