chiark / gitweb /
peerdb/tripe-newpeers.in: Sort the output so that testing is easier.
[tripe] / peerdb / tripe-newpeers.in
index aa9ccfcb5e4c91768250289e27adc246476f6f9f..d22aff7f94adbd96c9b1948a87fba64b95dc4b89 100644 (file)
@@ -303,7 +303,7 @@ def output(conf, cdb):
   This is where the special `user' and `auto' database entries get set.
   """
   auto = []
-  for sec in conf.sections():
+  for sec in sorted(conf.sections()):
     if sec.startswith('@'):
       continue
     elif sec.startswith('$'):
@@ -316,7 +316,7 @@ def output(conf, cdb):
       if conf.has_option(sec, 'user'):
         cdb.add('U%s' % conf.get(sec, 'user'), sec)
     url = M.URLEncode(laxp = True, semip = True)
-    for key, value in conf.items(sec):
+    for key, value in sorted(conf.items(sec), key = lambda (k, v): k):
       if not key.startswith('@'):
         url.encode(key, ' '.join(M.split(value)[0]))
     cdb.add(label, url.result)