def __init__(self):
        try:
            if settings.LDAP_MASTER_DISABLE == True: return
        except __HOLE__: pass
        try:
            logger.debug("TLS AVAILABLE? %d" % (ldap.TLS_AVAIL))
	    print "LDAP SETTINGS->"+settings.LDAP_MASTER_URI
            ldap.set_option(ldap.OPT_X_TLS_CACERTFILE, settings.LDAP_MASTER_CA)
            #ldap.set_option(ldap.OPT_X_TLS_CERTFILE, settings.LDAP_MASTER_CERT)
            #ldap.set_option(ldap.OPT_X_TLS_KEYFILE, settings.LDAP_MASTER_KEY)
            ldap.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, settings.LDAP_MASTER_REQCERT)
            ldap.set_option(ldap.OPT_TIMEOUT, settings.LDAP_MASTER_TIMEOUT)
            self.proxy = ldap.initialize (settings.LDAP_MASTER_URI)
            if settings.AUTH_LDAP_START_TLS:
                self.proxy.start_tls_s()
            self.proxy.simple_bind_s(settings.LDAP_MASTER_DN, settings.LDAP_MASTER_PWD)
            logger.debug ("LdapProxy.__init__: Connected to ldapserver %s as %s with CA in %s and with certificate %s and key %s" % (settings.LDAP_MASTER_URI, settings.LDAP_MASTER_DN, settings.LDAP_MASTER_CA, settings.LDAP_MASTER_CERT, settings.LDAP_MASTER_KEY))
        except ldap.LDAPError, error_message:
            logger.error ("LdapProxy.__init__: Failed connecting to ldapserver %s as %s with CA in %s and with certificate %s and key %s: %s" % (settings.LDAP_MASTER_URI, settings.LDAP_MASTER_DN, settings.LDAP_MASTER_CA, settings.LDAP_MASTER_CERT, settings.LDAP_MASTER_KEY, error_message))
            raise

    # not really possible to lock objects in de LDAP backend.
    # Howver, as expedients in different islands may compete, this becomes relevant.
    # Test 1: editing/saving several times a project, while fetching search results and (re)adding
    # object is commented out does not cause problems. Probably repeating the delete action raises
    # also a ldap.NO_SUCH_OBJECT that is silently discarded. ==> OK
    # Test 2: similar, but now deleting object is commented out. After second time, 
    # an ldap.ALREADY_EXISTS exception is raised. Either the calling code know how to deal with this
    # or user is confronted with an internal server error. ==> Good enough for now?
    # Crucial is to be careful that resubmitting does not destroy just-recedntly added data. But this 
    # should be a concern anyway.
    # Not really guarantee to be successful, but at least we try a couple of times to overcome this problem here.
dataset/ETHPy150Open fp7-ofelia/ocf/expedient/src/python/expedient/common/ldapproxy/models.py/LdapProxy.__init__