diff --git a/gestion/ldap_crans.py b/gestion/ldap_crans.py index 5c1603b0..2a910e04 100755 --- a/gestion/ldap_crans.py +++ b/gestion/ldap_crans.py @@ -12,7 +12,8 @@ Licence : GPLv2 from socket import gethostname date_format='%d/%m/%Y %H:%M' -if gethostname().split(".")[0] == "zamok": +hostname = gethostname().split(".")[0] +if hostname == "zamok": uri = 'ldapi://%2fvar%2frun%2fldapi/' else: uri = 'ldaps://zamok.crans.org:636/' @@ -21,7 +22,7 @@ smtpserv = "localhost" # TODO : # Interdire la modif des comptes nounou -import smtplib, sre, os, random, string, time, commands, sys +import smtplib, sre, os, random, string, time, sys import ldap, ldap.modlist import config, annuaires, iptools, chgpass, user_tests @@ -46,7 +47,6 @@ droits_possibles = [ u'Nounou', u'Apprenti', u'Mod ### Variables internes diverses isadm = user_tests.isadm() isdeconnecteur = user_tests.isdeconnecteur() -hostname = commands.getoutput('hostname') ann_scol = config.ann_scol ##################################################################################