def get_group_byid(self, gid):
"""Get group name for given group ID.
Raise RBFatalError if given id does not belong to a group in
group database."""
res = self.ldap.search_s(rbconfig.ldap_group_tree, ldap.SCOPE_ONELEVEL,
'gidNumber=%s' % gid)
if res:
return res[0][1]['cn'][0]
else:
raise RBFatalError("Group with id '%s' does not exist" % gid)
评论列表
文章目录