]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_manager: factorize with get_pool_dump
authorLoic Dachary <ldachary@redhat.com>
Wed, 19 Nov 2014 17:13:28 +0000 (18:13 +0100)
committerLoic Dachary <ldachary@redhat.com>
Thu, 20 Nov 2014 21:38:25 +0000 (22:38 +0100)
Replace code that duplicates get_osd_dump_json with a call to the
function.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
tasks/ceph_manager.py

index 118618ca09ec85950b9d0e66c53a1e6e63c56414..19a9053e19aafe8b1dedcf87bb5e764b0aabcb74 100644 (file)
@@ -727,12 +727,7 @@ class CephManager:
         """
         get number for pool (e.g., data -> 2)
         """
-        out = self.raw_cluster_cmd('osd', 'dump', '--format=json')
-        j = json.loads('\n'.join(out.split('\n')[1:]))
-        for i in j['pools']:
-            if i['pool_name'] == pool:
-                return int(i['pool'])
-        assert False
+        return int(self.get_pool_dump(pool)['pool'])
 
     def list_pools(self):
         """