[Blends-commit] [SCM] website branch, master, updated. 7776bbea228e66a76f2d7ea0ba7cd445629e57af
Andreas Tille
tille at debian.org
Fri Feb 8 14:08:56 UTC 2013
The following commit has been merged in the master branch:
commit 7776bbea228e66a76f2d7ea0ba7cd445629e57af
Author: Andreas Tille <tille at debian.org>
Date: Fri Feb 8 15:09:36 2013 +0100
Finally get the connection string correct to work on alioth properly
diff --git a/webtools/blendstasktoolsold.py b/webtools/blendstasktoolsold.py
index 89b4a7f..7a5a0ea 100644
--- a/webtools/blendstasktoolsold.py
+++ b/webtools/blendstasktoolsold.py
@@ -227,16 +227,21 @@ def GetDependencies2Use(dependencystatus=[], max_order='prospective'):
###########################################################################################
# Define several prepared statements to query UDD
try:
- conn = psycopg2.connect(host="localhost",port=PORT,user="guest",database="udd")
-except psycopg2.OperationalError:
- logger.debug("PostgreSQL does not seem to run on port %i .. trying default port %i." % (PORT, DEFAULTPORT))
- try:
- conn = psycopg2.connect(host="localhost",port=UDDPORT,user="guest",database="udd")
+ conn = psycopg2.connect(host="localhost",port=PORT,user="guest",database="udd")
+except psycopg2.OperationalError, err:
+ logger.debug("PostgreSQL does not seem to run on port %i .. trying default port %i." % (PORT, DEFAULTPORT))
+ try:
+ conn = psycopg2.connect(host="udd.debian.org",port=UDDPORT,user="guest",database="udd")
+ except psycopg2.OperationalError, err:
+ # logger not known at this state: logger.warning
+ print >>stderr, "PostgreSQL does not seem to run on port %i .. trying default port %i.\n\tMessage: %s" % (PORT, DEFAULTPORT, str(err))
+ try:
+ conn = psycopg2.connect(host="localhost",port=DEFAULTPORT,user="guest",database="udd")
except psycopg2.OperationalError:
- # Hmmm, I observed a really strange behaviour on one of my machines where connecting to
- # localhost does not work but 127.0.0.1 works fine. No odea why ... but this should
- # do the trick for the moment
- conn = psycopg2.connect(host="127.0.0.1",port=UDDPORT,user="guest",database="udd")
+ # Hmmm, I observed a really strange behaviour on one of my machines where connecting to
+ # localhost does not work but 127.0.0.1 works fine. No idea why ... but this should
+ # do the trick for the moment
+ conn = psycopg2.connect(host="127.0.0.1",port=DEFAULTPORT,user="guest",database="udd")
curs = conn.cursor()
query = """PREPARE query_pkg (text) AS SELECT
--
Static and dynamic websites for Debian Pure Blends
More information about the Blends-commit
mailing list