s4:samdb.py - Unification of the interfaces
[ira/wip.git] / source4 / scripting / python / samba / idmap.py
index 755ec52c7b4a66f9062a2bbc885772a86a42a952..ad209f42deb04829bf41c4caee3a2334c86f4f99 100644 (file)
@@ -23,8 +23,6 @@
 __docformat__ = "restructuredText"
 
 import samba
-import misc
-import ldb
 
 class IDmapDB(samba.Ldb):
     """The IDmap database."""
@@ -34,23 +32,23 @@ class IDmapDB(samba.Ldb):
     TYPE_GID = 2
     TYPE_BOTH = 3
 
-    def __init__(self, url=None, session_info=None, credentials=None,
-                 modules_dir=None, lp=None):
-        """Open the IDmap Database.
-
-        :param url: URL of the database.
+    def __init__(self, url=None, lp=None, modules_dir=None, session_info=None,
+                 credentials=None, flags=0, options=None):
+        """Opens the IDMap Database
+        For parameter meanings see the super class (samba.Ldb)
         """
+
         self.lp = lp
+        if url is None:
+                url = lp.get("idmap database")
 
-        super(IDmapDB, self).__init__(session_info=session_info, credentials=credentials,
-                                    modules_dir=modules_dir, lp=lp)
-        if url:
-            self.connect(url)
-        else:
-            self.connect(lp.get("idmap database"))
+        super(IDmapDB, self).__init__(url=url, lp=lp, modules_dir=modules_dir,
+                session_info=session_info, credentials=credentials, flags=flags,
+                options=options)
 
-    def connect(self, url):
-        super(IDmapDB, self).connect(misc.private_path(self.lp, url))
+    def connect(self, url=None, flags=0, options=None):
+        super(IDmapDB, self).connect(url=self.lp.private_path(url), flags=flags,
+                options=options)
 
     def setup_name_mapping(self, sid, type, unixid):
         """Setup a mapping between a sam name and a unix name.