s3-classicupgrade: Fix import from ldap
authorAndrew Bartlett <abartlet@samba.org>
Tue, 28 Aug 2012 01:19:04 +0000 (11:19 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 28 Aug 2012 07:49:39 +0000 (09:49 +0200)
We must not reference result before provision(), and do not need
session_info and lp for reading a normal ldap backend anyway.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Aug 28 09:49:39 CEST 2012 on sn-devel-104

source4/scripting/python/samba/upgrade.py

index 19a42c786aaff01383273f15f9dfe99838551b09..d3f0b8de16852c95de2235f4d35c5bbb589dc5a0 100644 (file)
@@ -775,13 +775,13 @@ Please fix this account before attempting to upgrade again
     pgids = {}
     if ldap:
         creds = Credentials()
-        creds.guess(s3param.get_context())
+        creds.guess(samba3.lp)
         creds.set_bind_dn(ldapuser)
         creds.set_password(ldappass)
         urls = samba3.lp.get("passdb backend").split(":",1)[1].strip('"')
         for url in urls.split():
             try:
-                ldb_object = Ldb(url, session_info=system_session(result.lp), credentials=creds, lp=result.lp)
+                ldb_object = Ldb(url, credentials=creds)
             except ldb.LdbError, e:
                 logger.warning("Could not open ldb connection to %s, the error message is: %s", url, e)
             else: