diff options
author | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-08-15 15:20:09 +0200 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de> | 2009-08-17 11:58:40 +0200 |
commit | 7a79d161838efcec27a159fc40481e7be419b778 (patch) | |
tree | b35df32b2a0284e9102648641646419f69b15674 /source4/scripting/python/samba/idmap.py | |
parent | 0a5ea25d21a9745508e118a20fca837e74b031df (diff) | |
download | samba-7a79d161838efcec27a159fc40481e7be419b778.tar.gz samba-7a79d161838efcec27a159fc40481e7be419b778.tar.bz2 samba-7a79d161838efcec27a159fc40481e7be419b778.zip |
s4: Major rework of the LDB/SAMDB/IDMAP python bindings
- Centralise the lookups for the default domain (root) in the call "domain_dn"
- Reduce the LDB connections attempts ("connect" calls) from three to one
- tools should load faster
- Make the LDB connection init more like the "ldb_wrap_connection" call
- Load the right UTF8 casefolder which fixes up problems with special characters
(discovered by me: e.g. small "Umlaute" (ä, ö, ü, ...) in the DN weren't upcased
- so records "seemed" lost in TDB)
Diffstat (limited to 'source4/scripting/python/samba/idmap.py')
-rw-r--r-- | source4/scripting/python/samba/idmap.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source4/scripting/python/samba/idmap.py b/source4/scripting/python/samba/idmap.py index ee79be1af9..acc98a56e8 100644 --- a/source4/scripting/python/samba/idmap.py +++ b/source4/scripting/python/samba/idmap.py @@ -32,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(self.lp.private_path(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. |