diff options
author | Gaetan Ferez <gaetan@ferez.fr> | 2019-02-15 13:47:21 +0100 |
---|---|---|
committer | Ilya Mashchenko <ilyamaschenko@gmail.com> | 2019-02-15 15:47:21 +0300 |
commit | 18fe4170054c98756a9d15500c4ca7f08e0cfef7 (patch) | |
tree | 9df24d274bcc5aa3b44c202c17d79a5e1c8e10ba /collectors/python.d.plugin/ceph | |
parent | 0d9049357b18a3801edd686b3525b53e80e00253 (diff) |
Fix ceph.chart.py for Python3 (#5396)
Diffstat (limited to 'collectors/python.d.plugin/ceph')
-rw-r--r-- | collectors/python.d.plugin/ceph/ceph.chart.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/collectors/python.d.plugin/ceph/ceph.chart.py b/collectors/python.d.plugin/ceph/ceph.chart.py index 45b52620f7..fe9b2b9ab2 100644 --- a/collectors/python.d.plugin/ceph/ceph.chart.py +++ b/collectors/python.d.plugin/ceph/ceph.chart.py @@ -161,7 +161,7 @@ class Service(SimpleService): :return: None """ # Pool lines - for pool in sorted(self._get_df()['pools']): + for pool in sorted(self._get_df()['pools'], key=lambda x:sorted(x.keys())): self.definitions['pool_usage']['lines'].append([pool['name'], pool['name'], 'absolute']) @@ -182,7 +182,7 @@ class Service(SimpleService): 'absolute']) # OSD lines - for osd in sorted(self._get_osd_df()['nodes']): + for osd in sorted(self._get_osd_df()['nodes'], key=lambda x:sorted(x.keys())): self.definitions['osd_usage']['lines'].append([osd['name'], osd['name'], 'absolute']) @@ -309,7 +309,7 @@ class Service(SimpleService): return json.loads(self.cluster.mon_command(json.dumps({ 'prefix': 'df', 'format': 'json' - }), '')[1]) + }), '')[1].decode('utf-8')) def _get_osd_df(self): """ @@ -319,7 +319,7 @@ class Service(SimpleService): return json.loads(self.cluster.mon_command(json.dumps({ 'prefix': 'osd df', 'format': 'json' - }), '')[1].replace('-nan', '"-nan"')) + }), '')[1].decode('utf-8').replace('-nan', '"-nan"')) def _get_osd_perf(self): """ @@ -329,7 +329,7 @@ class Service(SimpleService): return json.loads(self.cluster.mon_command(json.dumps({ 'prefix': 'osd perf', 'format': 'json' - }), '')[1]) + }), '')[1].decode('utf-8')) def _get_osd_pool_stats(self): """ @@ -341,4 +341,4 @@ class Service(SimpleService): return json.loads(self.cluster.mon_command(json.dumps({ 'prefix': 'osd pool stats', 'format': 'json' - }), '')[1]) + }), '')[1].decode('utf-8')) |