ldappr/ldappr/api.py.bak
Бородин Роман a38da31983 Python 3
2018-04-26 12:51:29 +03:00

14 lines
332 B
Python

import sys
import ldap
from connection import Connection, AuthConnection
def connect_to(server, *args, **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)