chgpass, ldap_crans: secrets_new
This commit is contained in:
parent
e8700aa131
commit
bba2b1cf9b
2 changed files with 8 additions and 10 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue