]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_manager: add get_osd_dump_json to get the full output
authorLoic Dachary <ldachary@redhat.com>
Wed, 19 Nov 2014 17:08:46 +0000 (18:08 +0100)
committerDavid Zafman <dzafman@redhat.com>
Wed, 4 Mar 2015 00:03:59 +0000 (16:03 -0800)
Converts ceph osd dump_json into a python object.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
(cherry picked from commit f353c150a8234644a25d7eeb073f4d3dd4af7c07)

tasks/ceph_manager.py

index a94e00660578c8c9a4df1a0e0b18eac9762c8a95..97402d0f91d3cad51f3860d33c987891622add5f 100644 (file)
@@ -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