From: Loic Dachary Date: Wed, 19 Nov 2014 17:08:46 +0000 (+0100) Subject: ceph_manager: add get_osd_dump_json to get the full output X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bd52d2f2557fc2fe22d60b09d95a59b0cc78aae2;p=ceph.git 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) --- diff --git a/tasks/ceph_manager.py b/tasks/ceph_manager.py index a94e0066057..97402d0f91d 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