sort PasswdAttrs as well as HostAttrs - now we can cmp debian.net as well as debian.org
authorStephen Gran <steve@lobefin.net>
Sun, 9 Aug 2009 23:26:10 +0000 (00:26 +0100)
committerStephen Gran <steve@lobefin.net>
Sun, 9 Aug 2009 23:26:10 +0000 (00:26 +0100)
Signed-off-by: Stephen Gran <steve@lobefin.net>
ud-generate

index 1377aaf..b57b0fd 100755 (executable)
@@ -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",\