From: Mark Hymers Date: Wed, 23 Mar 2011 14:36:28 +0000 (+0000) Subject: Work with service mode X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca92aad2e0267a71fc089db42bb3eb802065fb13;p=dak Work with service mode Signed-off-by: Mark Hymers --- diff --git a/dak/update_db.py b/dak/update_db.py index 985051ec..b58996b1 100755 --- a/dak/update_db.py +++ b/dak/update_db.py @@ -123,9 +123,12 @@ Updates dak's database schema to the lastest version. You should disable crontab try: # Build a connect string - connect_str = "dbname=%s"% (cnf["DB::Name"]) - if cnf["DB::Host"] != '': connect_str += " host=%s" % (cnf["DB::Host"]) - if cnf["DB::Port"] != '-1': connect_str += " port=%d" % (int(cnf["DB::Port"])) + if cnf["DB::Service"]: + connect_str = "service=%s" % cnf["DB::Service"] + else: + connect_str = "dbname=%s"% (cnf["DB::Name"]) + if cnf["DB::Host"] != '': connect_str += " host=%s" % (cnf["DB::Host"]) + if cnf["DB::Port"] != '-1': connect_str += " port=%d" % (int(cnf["DB::Port"])) self.db = psycopg2.connect(connect_str)