]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/ceph_daemon: preserve ordering
authorSage Weil <sage@redhat.com>
Wed, 26 Apr 2017 14:27:20 +0000 (10:27 -0400)
committerDan Mick <dan.mick@redhat.com>
Wed, 26 Apr 2017 18:20:46 +0000 (11:20 -0700)
Signed-off-by: Sage Weil <sage@redhat.com>
src/pybind/ceph_daemon.py

index 0979f396d9f876e9c208c791b417af8468847d8d..234a1866e6f500d1763db188bf15977663005f08 100755 (executable)
@@ -214,7 +214,7 @@ class DaemonWatcher(object):
         Get a possibly-truncated list of stats to display based on
         current terminal width.  Allow breaking mid-section.
         '''
-        current_fit = {}
+        current_fit = OrderedDict()
         if self.termsize.changed or not self._stats_that_fit:
             width = 0
             for section_name, names in self._stats.items():
@@ -223,7 +223,7 @@ class DaemonWatcher(object):
                     if width > self.termsize.cols:
                         break
                     if section_name not in current_fit:
-                        current_fit[section_name] = {}
+                        current_fit[section_name] = OrderedDict()
                     current_fit[section_name][name] = stat_data
                 if width > self.termsize.cols:
                     break