[digicode.py] fonctionnement sur asterisk
This commit is contained in:
parent
5253e7340c
commit
c8cee16a97
1 changed files with 5 additions and 4 deletions
|
@ -37,8 +37,8 @@ import cranslib.utils.files
|
||||||
# #############################################################
|
# #############################################################
|
||||||
# CONSTANTES
|
# CONSTANTES
|
||||||
# #############################################################
|
# #############################################################
|
||||||
CODES_SERVER = "zamok"
|
CODES_SERVERS = ["zamok", "asterisk"]
|
||||||
CODES_DIR = "/var/impression/codes/"
|
CODES_DIR = "/usr/scripts/var/digicode/"
|
||||||
|
|
||||||
|
|
||||||
# #############################################################
|
# #############################################################
|
||||||
|
@ -52,10 +52,11 @@ def CodeAlreadyExists(Exception):
|
||||||
# #############################################################
|
# #############################################################
|
||||||
# test pour voir si on est bien sur la bonne machine
|
# test pour voir si on est bien sur la bonne machine
|
||||||
import socket
|
import socket
|
||||||
if socket.gethostname() != CODES_SERVER:
|
if socket.gethostname() not in CODES_SERVERS:
|
||||||
CODES_DIR = tempfile.mkdtemp(prefix='fake_digicode')
|
CODES_DIR = tempfile.mkdtemp(prefix='fake_digicode')
|
||||||
FAKE_DIR = True
|
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:
|
else:
|
||||||
FAKE_DIR = False
|
FAKE_DIR = False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue