added try catch
This commit is contained in:
parent
de650f2858
commit
f1633a429e
@ -1,8 +1,13 @@
|
||||
import sys
|
||||
import ldap
|
||||
from connection import Connection, AuthConnection
|
||||
|
||||
|
||||
def connect_to(server, *args, **kwargs):
|
||||
if args or 'bind_dn' and 'password' in kwargs:
|
||||
#if args:
|
||||
return AuthConnection(server, *args, **kwargs)
|
||||
return Connection(server, **kwargs)
|
||||
try:
|
||||
if args or 'bind_dn' and 'password' in kwargs:
|
||||
return AuthConnection(server, *args, **kwargs)
|
||||
return Connection(server, **kwargs)
|
||||
except Exception as e:
|
||||
print str(e)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user