From 8982c4a13f70a9ff541f7ef33b693b0812feb7a1 Mon Sep 17 00:00:00 2001 From: Stephen Gran Date: Mon, 10 Aug 2009 00:26:10 +0100 Subject: [PATCH] sort PasswdAttrs as well as HostAttrs - now we can cmp debian.net as well as debian.org Signed-off-by: Stephen Gran --- ud-generate | 2 ++ 1 file changed, 2 insertions(+) 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",\ -- 2.20.1