ajoute DBG_INTRANET
This commit is contained in:
parent
ebeab8a0a0
commit
52c3795255
4 changed files with 12 additions and 16 deletions
|
@ -26,6 +26,7 @@
|
|||
Copyright (c) 2006, 2007, 2008, 2009 by Cr@ns (http://www.crans.org)
|
||||
"""
|
||||
import sys
|
||||
import os
|
||||
import requests
|
||||
if '/usr/scripts' not in sys.path:
|
||||
sys.path.append("/usr/scripts")
|
||||
|
@ -37,20 +38,14 @@ digicode_pass = secrets_new.get("digicode_pass")
|
|||
# #############################################################
|
||||
# CONSTANTES
|
||||
# #############################################################
|
||||
CODES_SERVERS = ["zamok", "asterisk", "vo"]
|
||||
CODES_DIR = "/usr/scripts/var/digicode/"
|
||||
CREATION_LINK = "https://intranet2.crans.org/digicode/create/"
|
||||
LIST_LINK = "https://intranet2.crans.org/digicode/list/"
|
||||
INTRANET = os.getenv('DBG_INTRANET', 'intranet2.crans.org')
|
||||
CREATION_LINK = "https://%s/digicode/create/" % INTRANET
|
||||
LIST_LINK = "https://%s/digicode/list/" % INTRANET
|
||||
CERTIFICATE = "/etc/ssl/certs/cacert.org.pem"
|
||||
|
||||
# #############################################################
|
||||
# FONCTIONS
|
||||
# #############################################################
|
||||
# test pour voir si on est bien sur la bonne machine
|
||||
import socket
|
||||
if socket.gethostname() not in CODES_SERVERS:
|
||||
raise EnvironmentError("La manipulation des codes pour le digicode n'est possible que sur %s" %
|
||||
', '.join(CODES_SERVERS))
|
||||
|
||||
class CommunicationError(Exception):
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue