def uidNumber_findmax(self):
"""Return highest uidNumber found in LDAP accounts tree.
This is only used to create the uidNumber file, the
uidNumber_readnext() function should be used for getting the
next available uidNumber."""
res = self.ldap.search_s(rbconfig.ldap_accounts_tree,
ldap.SCOPE_ONELEVEL,
'objectClass=posixAccount', ('uidNumber', ))
maxuid = -1
for i in res:
tmp = int(i[1]['uidNumber'][0])
if tmp > maxuid:
maxuid = tmp
return maxuid
评论列表
文章目录