From: Stephen Gran Date: Sun, 9 Aug 2009 23:26:10 +0000 (+0100) Subject: sort PasswdAttrs as well as HostAttrs - now we can cmp debian.net as well as debian.org X-Git-Tag: userdir-ldap-0.3.71~6 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=8982c4a13f70a9ff541f7ef33b693b0812feb7a1 sort PasswdAttrs as well as HostAttrs - now we can cmp debian.net as well as debian.org Signed-off-by: Stephen Gran --- diff --git a/ud-generate b/ud-generate index 1377aaf..b57b0fd 100755 --- a/ud-generate +++ b/ud-generate @@ -1067,6 +1067,8 @@ PasswdAttrs = l.search_s(BaseDn, ldap.SCOPE_ONELEVEL, "uid=*",\ if PasswdAttrs is None: raise UDEmptyList, "No Users" +HostAttrs.sort(lambda x, y: cmp((GetAttr(x, "uid")).lower(), (GetAttr(y, "uid")).lower())) + # Fetch all the hosts HostAttrs = l.search_s(HostBaseDn, ldap.SCOPE_ONELEVEL, "objectClass=debianServer",\ ["hostname", "sshRSAHostKey", "purpose", "allowedGroups", "exportOptions",\