Update moulinette/authenticators/ldap.py

Co-authored-by: Alexandre Aubin <alex.aubin@mailoo.org>
This commit is contained in:
Bram 2020-05-07 21:53:38 +02:00 committed by GitHub
parent b97ac05aad
commit f2e9f26e52
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -92,7 +92,7 @@ class Authenticator(BaseAuthenticator):
raise MoulinetteError("invalid_password") raise MoulinetteError("invalid_password")
except ldap.SERVER_DOWN: except ldap.SERVER_DOWN:
# ldap is down, attempt to restart it before really failing # ldap is down, attempt to restart it before really failing
logger.warning(m18n.g("ldap_server_down")) logger.warning(m18n.g("ldap_server_is_down_restart_it"))
os.system("systemctl restart slapd") os.system("systemctl restart slapd")
time.sleep(10) # waits 10 secondes so we are sure that slapd has restarted time.sleep(10) # waits 10 secondes so we are sure that slapd has restarted