]> git.decadent.org.uk Git - dak.git/commitdiff
Fix dak update-db
authorAnsgar Burchardt <ansgar@debian.org>
Wed, 23 Mar 2011 17:51:31 +0000 (17:51 +0000)
committerAnsgar Burchardt <ansgar@43-1.org>
Wed, 23 Mar 2011 18:39:17 +0000 (19:39 +0100)
dak/update_db.py

index 3effa47741362500138fd6a18df0b8821837b362..b2ca7a86b7af90fa898241bdb6307006866a5960 100755 (executable)
@@ -123,7 +123,7 @@ Updates dak's database schema to the lastest version. You should disable crontab
 
         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"])
@@ -134,7 +134,7 @@ Updates dak's database schema to the lastest version. You should disable crontab
 
         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()])