Browse Source

[2298] in case of dict change the way to sort by key name

Naoki Kambe 12 years ago
parent
commit
f3c3c9b801
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/bin/stats/stats_httpd.py.in

+ 3 - 2
src/bin/stats/stats_httpd.py.in

@@ -112,14 +112,15 @@ def item_name_list(element, identifier):
     if type(elem) is dict:
         if ident:
             ident = ident + '/'
-        for (key, value) in elem.items():
+        keys = list(elem.keys())
+        keys.sort()
+        for key in keys:
             idstr = '%s%s' % (ident, key)
             ret += item_name_list(element, idstr)
     elif type(elem) is list:
         for i in range(0, len(elem)):
             idstr = '%s[%d]' % (ident, i)
             ret += item_name_list(element, idstr)
-    ret.sort()
     return ret
 
 class HttpHandler(http.server.BaseHTTPRequestHandler):