testing.sh: peut indiquer un host ldap et/ou pg

This commit is contained in:
Daniel STAN 2015-06-17 10:05:09 +02:00
parent 85785c1f80
commit bbf4ad6ade
3 changed files with 23 additions and 6 deletions

View file

@ -19,10 +19,12 @@ def _need_conn(f):
raise NameError("La connexion à la pase postgresql ne peut être établie.")
attempts = 0
while not conn or not attempts:
if __name__.endswith('annuaires_pg_test') or os.getenv('DBG_ANNUAIRE', False):
host = os.getenv('DBG_ANNUAIRE', 'pgsql.v4.adm.crans.org')
# Test habituel sur vo:
if host == '1' or __name__.endswith('annuaires_pg_test'):
host='localhost'
else:
host='pgsql.v4.adm.crans.org'
# "connecting …"
try:
if not conn: