]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Improve readability
authorPatrick Nawracay <pnawracay@suse.com>
Mon, 27 Aug 2018 13:14:23 +0000 (15:14 +0200)
committerPatrick Nawracay <pnawracay@suse.com>
Tue, 4 Sep 2018 06:27:03 +0000 (08:27 +0200)
Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
src/pybind/mgr/dashboard/controllers/osd.py

index 43cd6c8ffba390f6d9b742b530db2abbcce80c87..3d30df83ed1e4cf061c03dff4cd62bb3a4b99265 100644 (file)
@@ -13,20 +13,24 @@ from ..tools import str_to_bool
 class Osd(RESTController):
     def list(self):
         osds = self.get_osd_map()
+
         # Extending by osd stats information
         for s in mgr.get('osd_stats')['osd_stats']:
             osds[str(s['osd'])].update({'osd_stats': s})
+
         # Extending by osd node information
         nodes = mgr.get('osd_map_tree')['nodes']
         osd_tree = [(str(o['id']), o) for o in nodes if o['id'] >= 0]
         for o in osd_tree:
             osds[o[0]].update({'tree': o[1]})
+
         # Extending by osd parent node information
         hosts = [(h['name'], h) for h in nodes if h['id'] < 0]
         for h in hosts:
             for o_id in h[1]['children']:
                 if o_id >= 0:
                     osds[str(o_id)]['host'] = h[1]
+
         # Extending by osd histogram data
         for o_id in osds:
             o = osds[o_id]
@@ -40,6 +44,7 @@ class Osd(RESTController):
             # Gauge stats
             for s in ['osd.numpg', 'osd.stat_bytes', 'osd.stat_bytes_used']:
                 o['stats'][s.split('.')[1]] = mgr.get_latest('osd', osd_spec, s)
+
         return list(osds.values())
 
     def get_osd_map(self):