]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: collect all mds in mdsids() 17565/head
authorKefu Chai <kchai@redhat.com>
Tue, 5 Sep 2017 08:33:24 +0000 (16:33 +0800)
committerAbhishek Lekshmanan <abhishek@suse.com>
Thu, 7 Sep 2017 13:09:08 +0000 (15:09 +0200)
otherwise, only the active mds are returned.

Fixes: http://tracker.ceph.com/issues/21230
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit dd702cc94e32f533f0f2e76f9d202d1fa7c6a57f)

src/ceph.in

index 4843fec9e0b5e576a79eb5e3d74b50f48163af42..cb1bd86941950a99012db3e913cde9b90de4f2ca 100755 (executable)
@@ -173,15 +173,17 @@ def monids():
 
 
 def mdsids():
-    ret, outbuf, outs = json_command(cluster_handle, prefix='mds dump',
+    ret, outbuf, outs = json_command(cluster_handle, prefix='fs dump',
                                      argdict={'format': 'json'})
     if ret:
         raise RuntimeError('Can\'t contact mon for mds list')
     d = json.loads(outbuf.decode('utf-8'))
     l = []
-    infodict = d['info']
-    for mdsdict in infodict.values():
-        l.append(mdsdict['name'])
+    for info in d['standbys']:
+        l.append(info['name'])
+    for fs in d['filesystems']:
+        for info in fs['mdsmap']['info'].values():
+            l.append(info['name'])
     return l