[sagenb] 36/179: _ldap_search: moved bind back inside the try block

felix salfelder felix-guest at moszumanska.debian.org
Tue May 6 12:05:07 UTC 2014


This is an automated email from the git hooks/post-receive script.

felix-guest pushed a commit to branch master
in repository sagenb.

commit ea395bc2cd1871463886f5617985093098338f33
Author: Robin Martinjak <rob at rmartinjak.de>
Date:   Fri Nov 2 14:59:44 2012 +0100

    _ldap_search: moved bind back inside the try block
---
 sagenb/notebook/auth.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sagenb/notebook/auth.py b/sagenb/notebook/auth.py
index 1daf601..00d7865 100644
--- a/sagenb/notebook/auth.py
+++ b/sagenb/notebook/auth.py
@@ -68,13 +68,13 @@ class LdapAuth(AuthMethod):
         from ldap.sasl import gssapi
         conn = ldap.initialize(self._conf['ldap_uri'])
 
-        if self._conf['ldap_gssapi']:
-            token = gssapi()
-            conn.sasl_interactive_bind_s('', token)
-        else:
-            conn.simple_bind_s(self._conf['ldap_binddn'], self._conf['ldap_bindpw'])
-
         try:
+            if self._conf['ldap_gssapi']:
+                token = gssapi()
+                conn.sasl_interactive_bind_s('', token)
+            else:
+                conn.simple_bind_s(self._conf['ldap_binddn'], self._conf['ldap_bindpw'])
+
             result = conn.search_ext_s(
                     self._conf['ldap_basedn'],
                     ldap.SCOPE_SUBTREE,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagenb.git



More information about the debian-science-commits mailing list