Be more verbose when logging errors in info LDAP plugin
[cascardo/ipsilon.git] / ipsilon / login / authldap.py
index 1986490..6e9afd3 100644 (file)
@@ -233,7 +233,13 @@ class Installer(LoginManagerInstaller):
                 opts['ldap_bind_dn_template'] % {'username': 'test'}
             except KeyError:
                 logging.error(
                 opts['ldap_bind_dn_template'] % {'username': 'test'}
             except KeyError:
                 logging.error(
-                    'Bind DN template does not container %(username)s'
+                    'Bind DN template does not contain %(username)s'
+                )
+                return False
+            except ValueError as e:
+                logging.error(
+                    'Invalid syntax in Bind DN template: %s ',
+                    e
                 )
                 return False
             config['bind dn template'] = opts['ldap_bind_dn_template']
                 )
                 return False
             config['bind dn template'] = opts['ldap_bind_dn_template']