+ gidnumber_found = 0;
+ for key in Attrs[0][1].keys():
+ if (key == "gidNumber"):
+ gidnumber_found = 1
+
+ if (gidnumber_found != 1):
+ raise Error, "No gidnumber in attributes for fingerprint %s" % FingerPrint
+
+ # Look for the group with the gid of the user
+ GAttr = l.search_s(LDAPDn,ldap.SCOPE_ONELEVEL,"(&(objectClass=debianGroup)(gidnumber=%s))" % Attrs[0][1]["gidNumber"][0], ["gid"])
+ if len(GAttr) == 0:
+ raise Error, "Database inconsistency found: main group for account not found in database"
+