ud-generate: remove a trailing semi-colon
[mirror/userdir-ldap.git] / userdir_ldap.py
index d47909d..22722e4 100644 (file)
@@ -135,7 +135,7 @@ def connectLDAP(server=None):
    if server is None:
       global LDAPServer
       server = LDAPServer
-   lc = ldap.open(server)
+   lc = ldap.initialize('ldap://%s' % server)
    global UseSSL
    if UseSSL:
       lc.start_tls_s()
@@ -244,7 +244,7 @@ def HashPass(Password):
       Salt = Salt + SaltVals[ord(Rand.read(1)[0]) % len(SaltVals)]
    Pass = crypt.crypt(Password, Salt)
    if len(Pass) < 14:
-      raise "Password Error", "MD5 password hashing failed, not changing the password!"
+      raise Exception("MD5 password hashing failed, not changing the password!")
    return Pass