DBG_ANNUAIRE: pour l'annuaire pg

This commit is contained in:
Daniel STAN 2014-11-04 13:20:53 +01:00
parent 927117b6dd
commit 010fe3b10e
2 changed files with 5 additions and 1 deletions

View file

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import os
import psycopg2
from functools import wraps
import time
@ -18,7 +19,7 @@ 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'):
if __name__.endswith('annuaires_pg_test') or os.getenv('DBG_ANNUAIRE', False):
host='localhost'
else:
host='pgsql.v4.adm.crans.org'