summaryrefslogtreecommitdiff
path: root/source4/scripting/python/samba/idmap.py
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-06-10 23:12:53 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-11 01:47:55 +0200
commitc446fbc3bfa345c8bc748a162dedb24857272aab (patch)
tree4abfb08ff2c994045de37896f2d2666adedf4ef3 /source4/scripting/python/samba/idmap.py
parenta53ca944163f5366493b4c36ed94fd9f92e86238 (diff)
downloadsamba-c446fbc3bfa345c8bc748a162dedb24857272aab.tar.gz
samba-c446fbc3bfa345c8bc748a162dedb24857272aab.tar.bz2
samba-c446fbc3bfa345c8bc748a162dedb24857272aab.zip
s4-python: Fix formatting.
Diffstat (limited to 'source4/scripting/python/samba/idmap.py')
-rw-r--r--source4/scripting/python/samba/idmap.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/source4/scripting/python/samba/idmap.py b/source4/scripting/python/samba/idmap.py
index c0b20bd257..1cb33fd0a9 100644
--- a/source4/scripting/python/samba/idmap.py
+++ b/source4/scripting/python/samba/idmap.py
@@ -57,28 +57,27 @@ class IDmapDB(samba.Ldb):
:return xid can that be used for SID/unixid mapping
"""
- res=self.search(expression="dn=CN=CONFIG",base="", scope=ldb.SCOPE_SUBTREE)
- id=res[0].get("xidNumber")
- flag=ldb.FLAG_MOD_REPLACE
- if id == None:
- id=res[0].get("lowerBound")
+ res = self.search(expression="dn=CN=CONFIG", base="",
+ scope=ldb.SCOPE_SUBTREE)
+ id = res[0].get("xidNumber")
+ flag = ldb.FLAG_MOD_REPLACE
+ if id is None:
+ id = res[0].get("lowerBound")
flag = ldb.FLAG_MOD_ADD
newid = int(str(id)) + 1
msg = ldb.Message()
- msg.dn = ldb.Dn(self,"CN=CONFIG")
- msg["xidNumber"] = ldb.MessageElement(str(newid),flag,"xidNumber")
+ msg.dn = ldb.Dn(self, "CN=CONFIG")
+ msg["xidNumber"] = ldb.MessageElement(str(newid), flag, "xidNumber")
self.modify(msg)
-
return id
-
def setup_name_mapping(self, sid, type, unixid=None):
"""Setup a mapping between a sam name and a unix name.
:param sid: SID of the NT-side of the mapping.
:param unixname: Unix id to map to, if none supplied the next one will be selected
"""
- if unixid == None:
+ if unixid is None:
unixid = self.increment_xid()
type_string = ""
if type == self.TYPE_UID: