summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-04-27 16:35:07 +0200
committerRob Crittenden <rcritten@redhat.com>2010-04-27 16:29:36 -0400
commit44c18444935443e3ea1cb9bb6c543a436bc84cd8 (patch)
tree1e271127e5df547a4e972cdafd96f9019406e347 /ipaserver
parent9dc7cf93387403a8b27ae223958d99c5fa127edd (diff)
downloadfreeipa-44c18444935443e3ea1cb9bb6c543a436bc84cd8.tar.gz
freeipa-44c18444935443e3ea1cb9bb6c543a436bc84cd8.tar.xz
freeipa-44c18444935443e3ea1cb9bb6c543a436bc84cd8.zip
Replace a new instance of IPAdmin use in ipa-server-install.
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/plugins/ldap2.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py
index 33b85f352..d1c083f20 100644
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -262,19 +262,19 @@ class ldap2(CrudBackend, Encoder):
if tls_keyfile is not None:
_ldap.set_option(_ldap.OPT_X_TLS_KEYFILE, tls_keyfile)
- conn = _ldap.initialize(self.ldap_uri)
- if ccache is not None:
- try:
+ try:
+ conn = _ldap.initialize(self.ldap_uri)
+ if ccache is not None:
os.environ['KRB5CCNAME'] = ccache
conn.sasl_interactive_bind_s('', SASL_AUTH)
principal = krbV.CCache(name=ccache,
context=krbV.default_context()).principal().name
setattr(context, 'principal', principal)
- except _ldap.LDAPError, e:
- _handle_errors(e, **{})
- else:
- # no kerberos ccache, use simple bind
- conn.simple_bind_s(bind_dn, bind_pw)
+ else:
+ # no kerberos ccache, use simple bind
+ conn.simple_bind_s(bind_dn, bind_pw)
+ except _ldap.LDAPError, e:
+ _handle_errors(e, **{})
return conn
def destroy_connection(self):