- 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.has_key("DB::Service"):
+ connect_str = "service=%s" % cnf["DB::Service"]
+ else:
+ connect_str = "dbname=%s"% (cnf["DB::Name"])
+ if cnf.has_key("DB::Host") and cnf["DB::Host"] != '':
+ connect_str += " host=%s" % (cnf["DB::Host"])
+ if cnf.has_key("DB::Port") and cnf["DB::Port"] != '-1':
+ connect_str += " port=%d" % (int(cnf["DB::Port"]))