From bd52d2f2557fc2fe22d60b09d95a59b0cc78aae2 Mon Sep 17 00:00:00 2001 From: Loic Dachary Date: Wed, 19 Nov 2014 18:08:46 +0100 Subject: [PATCH] ceph_manager: add get_osd_dump_json to get the full output Converts ceph osd dump_json into a python object. Signed-off-by: Loic Dachary (cherry picked from commit f353c150a8234644a25d7eeb073f4d3dd4af7c07) --- tasks/ceph_manager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tasks/ceph_manager.py b/tasks/ceph_manager.py index a94e00660578c..97402d0f91d3c 100644 --- a/tasks/ceph_manager.py +++ b/tasks/ceph_manager.py @@ -1065,6 +1065,14 @@ class CephManager: return None + def get_osd_dump_json(self): + """ + osd dump --format=json converted to a python object + :returns: the python object + """ + out = self.raw_cluster_cmd('osd', 'dump', '--format=json') + return json.loads('\n'.join(out.split('\n')[1:])) + def get_osd_dump(self): """ Dump osds -- 2.39.5