'Returns LDAP URL suitable to be passed to ldap.initialize()'

def initializeUrl(self):

    if (self.urlscheme == 'ldapi'):
        hostport = ldapUrlEscape(self.hostport)
    else:
        hostport = self.hostport
    return ('%s://%s' % (self.urlscheme, hostport))
