From: Stephen Gran Date: Sun, 9 Aug 2009 22:22:06 +0000 (+0000) Subject: Sort HostAttrs - this isn't important now, but will let us do things X-Git-Tag: userdir-ldap-0.3.71~10 X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=32271a3e086af9ccd6f2827148fe019e53ffbfa2;hp=4a91a8bbf1b3f03a58c61ba6a18e12f8c622fd75;p=mirror%2Fuserdir-ldap.git Sort HostAttrs - this isn't important now, but will let us do things like check if the zone file has changed later Signed-off-by: Stephen Gran --- diff --git a/ud-generate b/ud-generate index 5ba59d4..2319787 100755 --- a/ud-generate +++ b/ud-generate @@ -1083,6 +1083,8 @@ HostAttrs = l.search_s(HostBaseDn, ldap.SCOPE_ONELEVEL, "objectClass=debianSe if HostAttrs == None: raise UDEmptyList, "No Hosts" +HostAttrs.sort(lambda x, y: cmp((GetAttr(x, "hostname")).lower(), (GetAttr(y, "hostname")).lower())) + # Generate global things GlobalDir = GenerateDir + "/" GenDisabledAccounts(GlobalDir + "disabled-accounts")