From dd702cc94e32f533f0f2e76f9d202d1fa7c6a57f Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Tue, 5 Sep 2017 16:33:24 +0800 Subject: [PATCH] ceph: collect all mds in mdsids() otherwise, only the active mds are returned. Fixes: http://tracker.ceph.com/issues/21230 Signed-off-by: Kefu Chai --- src/ceph.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ceph.in b/src/ceph.in index 4843fec9e0b5e..cb1bd86941950 100755 --- a/src/ceph.in +++ b/src/ceph.in @@ -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 -- 2.39.5