svn commit: samba r25899 - in branches/4.0-python: . source/scripting/python/samba

jelmer at samba.org jelmer at samba.org
Wed Nov 7 22:11:47 GMT 2007


Author: jelmer
Date: 2007-11-07 22:11:45 +0000 (Wed, 07 Nov 2007)
New Revision: 25899

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25899

Log:
Fix modules dir during provisioning.
Modified:
   branches/4.0-python/
   branches/4.0-python/source/scripting/python/samba/__init__.py
   branches/4.0-python/source/scripting/python/samba/provision.py


Changeset:

Property changes on: branches/4.0-python
___________________________________________________________________
Name: bzr:revision-info
...skipped...
Name: bzr:revision-id:v3-trunk0
...skipped...

Modified: branches/4.0-python/source/scripting/python/samba/__init__.py
===================================================================
--- branches/4.0-python/source/scripting/python/samba/__init__.py	2007-11-07 22:11:41 UTC (rev 25898)
+++ branches/4.0-python/source/scripting/python/samba/__init__.py	2007-11-07 22:11:45 UTC (rev 25899)
@@ -18,10 +18,16 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #
 
+import os
 
-def Ldb(url, session_info=None, credentials=None):
+def Ldb(url, session_info=None, credentials=None, modules_dir=None):
     import ldb
-    return ldb.Ldb(url)
+    ret = ldb.Ldb()
+    if modules_dir is None:
+        modules_dir = os.path.join(os.getcwd(), "bin", "modules", "ldb")
+    ret.set_modules_dir(modules_dir)
+    ret.connect(url)
+    return ret
 
 #
 #  substitute strings of the form ${NAME} in str, replacing

Modified: branches/4.0-python/source/scripting/python/samba/provision.py
===================================================================
--- branches/4.0-python/source/scripting/python/samba/provision.py	2007-11-07 22:11:41 UTC (rev 25898)
+++ branches/4.0-python/source/scripting/python/samba/provision.py	2007-11-07 22:11:45 UTC (rev 25899)
@@ -268,6 +268,7 @@
             if len(res3) != 0:
                 message("Failed to delete all records under %s, %d records remaining" % (basedn, len(res3)))
 
+
 def open_ldb(session_info, credentials, dbname):
     try:
         return Ldb(dbname, session_info=session_info, credentials=credentials)



More information about the samba-cvs mailing list