Commit bba2b1cf authored by Daniel STAN's avatar Daniel STAN

chgpass, ldap_crans: secrets_new

parent e8700aa1
......@@ -22,12 +22,9 @@ import getpass, commands, os, sys, base64, syslog
from user_tests import getuser, isadm
from affich_tools import cprint
try :
sys.path.append('/usr/scripts/gestion/secrets')
from secrets import ldap_password, ldap_auth_dn
except :
ldap_password = ''
ldap_auth_dn = ''
import secrets_new as secrets
ldap_password = secrets.get("ldap_password")
ldap_auth_dn = secrets.get("ldap_auth_dn")
uri = 'ldap://ldap.adm.crans.org'
syslog.openlog('chgpass',syslog.LOG_PID,syslog.LOG_AUTH)
......
......@@ -25,6 +25,7 @@ from email_tools import send_email
from syslog import openlog, closelog, syslog
from numeros_disponibles import lister_ip_dispo
from unicodedata import normalize
import secrets_new as secrets
import ridtools
date_format = '%d/%m/%Y %H:%M'
......@@ -63,8 +64,8 @@ elif hostname in test_hosts:
# avec le secret
try:
sys.path.append('/usr/scripts/gestion/secrets')
from secrets import ldap_password, ldap_auth_dn
ldap_auth_dn = secrets.get('ldap_auth_dn')
ldap_password = secrets.get('ldap_password')
except:
sys.stdout.write(coul('Warning : impossible de lire le fichier de secret !\n', 'jaune'))
sys.exit(1)
......@@ -80,8 +81,8 @@ else:
# avec le secret
try:
sys.path.append('/usr/scripts/gestion/secrets')
from secrets import ldap_password, ldap_auth_dn
ldap_auth_dn = secrets.get('ldap_auth_dn')
ldap_password = secrets.get('ldap_password')
except:
sys.stdout.write(coul('Warning : impossible de lire le fichier de secret !\n', 'jaune'))
sys.exit(1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment