python/kcc: Write correct module list into the file during ldif_to_samdb
authorAndrew Bartlett <abartlet@samba.org>
Mon, 14 Sep 2015 01:48:04 +0000 (13:48 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 26 Oct 2015 04:11:21 +0000 (05:11 +0100)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
python/samba/kcc/ldif_import_export.py

index ab7c7a0a1bf850a659c30ffb2ea88c5b8d08bce7..76986f3eed08b3bf465126c5e5d7582fc0dbf05f 100644 (file)
@@ -70,9 +70,13 @@ def ldif_to_samdb(dburl, lp, ldif_file, forced_local_dsa=None):
 changetype: modify
 replace: dsServiceName
 dsServiceName: CN=NTDS Settings,%s
--
             """ % forced_local_dsa)
 
+        tmpdb.add_ldif("""dn: @MODULES
+@LIST: rootdse,extended_dn_in,extended_dn_out_ldb
+-
+""")
+
     except Exception, estr:
         tmpdb.transaction_cancel()
         raise LdifError("Failed to import %s: %s" % (ldif_file, estr))
@@ -82,9 +86,7 @@ dsServiceName: CN=NTDS Settings,%s
     # We have an abbreviated list of options here because we have built
     # an abbreviated database.  We use the rootdse and extended-dn
     # modules only during this re-open
-    samdb = SamDB(url=dburl, session_info=system_session(), lp=lp,
-                  options=["modules:rootdse,extended_dn_in,"
-                           "extended_dn_out_ldb"])
+    samdb = SamDB(url=dburl, session_info=system_session(), lp=lp)
     return samdb