diff --git a/impression/digicode.py b/impression/digicode.py index 2f6d782d..68bd0a89 100644 --- a/impression/digicode.py +++ b/impression/digicode.py @@ -37,8 +37,8 @@ import cranslib.utils.files # ############################################################# # CONSTANTES # ############################################################# -CODES_SERVER = "zamok" -CODES_DIR = "/var/impression/codes/" +CODES_SERVERS = ["zamok", "asterisk"] +CODES_DIR = "/usr/scripts/var/digicode/" # ############################################################# @@ -52,10 +52,11 @@ def CodeAlreadyExists(Exception): # ############################################################# # test pour voir si on est bien sur la bonne machine import socket -if socket.gethostname() != CODES_SERVER: +if socket.gethostname() not in CODES_SERVERS: CODES_DIR = tempfile.mkdtemp(prefix='fake_digicode') FAKE_DIR = True - #raise EnvironmentError, "La manipulation des codes pour le digicode n'est possible que sur %s" % CODES_SERVER + raise EnvironmentError("La manipulation des codes pour le digicode n'est possible que sur %s" % + ', '.join(CODES_SERVERS)) else: FAKE_DIR = False