################################################################################
Cnf = None
-required_database_schema = 49
+required_database_schema = 64
################################################################################
# Ok, try and find the configuration table
print "Determining dak database revision ..."
cnf = Config()
- logger = Logger(cnf.Cnf, 'update-db')
+ logger = Logger('update-db')
try:
# Build a connect string
- if cnf["DB::Service"]:
+ if cnf.has_key("DB::Service"):
connect_str = "service=%s" % cnf["DB::Service"]
else:
connect_str = "dbname=%s"% (cnf["DB::Name"])
except:
print "FATAL: Failed connect to database"
- pass
+ sys.exit(1)
database_revision = int(self.get_db_rev())
logger.log(['transaction id before update: %s' % self.get_transaction_id()])
self.usage(exit_code=1)
try:
- lock_fd = os.open(cnf["Dinstall::LockFile"], os.O_RDWR | os.O_CREAT)
+ lock_fd = os.open(os.path.join(cnf["Dir::Lock"], 'dinstall.lock'), os.O_RDWR | os.O_CREAT)
fcntl.lockf(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError, e:
if errno.errorcode[e.errno] == 'EACCES' or errno.errorcode[e.errno] == 'EAGAIN':