From fcc84edc85d00419c9592cb154fb173489f9f8da Mon Sep 17 00:00:00 2001 From: Gu Zhongyan Date: Fri, 9 Mar 2018 18:06:29 +0800 Subject: [PATCH] mon: node ls improvement output mon/mds name instead of their rank Signed-off-by: Gu Zhongyan --- src/mon/MDSMonitor.cc | 5 ++--- src/mon/Monitor.cc | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index 387f4706cd4ae..14c5e10511825 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -1735,7 +1735,7 @@ int MDSMonitor::print_nodes(Formatter *f) return r; } - map > mdses; // hostname => rank + map > mdses; // hostname => mds for (map::iterator it = metadata.begin(); it != metadata.end(); ++it) { const Metadata& m = it->second; @@ -1750,8 +1750,7 @@ int MDSMonitor::print_nodes(Formatter *f) continue; } const MDSMap::mds_info_t& mds_info = fsmap.get_info_gid(gid); - // FIXME: include filesystem name with rank here - mdses[hostname->second].push_back(mds_info.rank); + mdses[hostname->second].push_back(mds_info.name); } dump_services(f, mdses, "mds"); diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 74866fa4a2f99..ac319fe39400c 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -4969,7 +4969,7 @@ void Monitor::count_metadata(const string& field, Formatter *f) int Monitor::print_nodes(Formatter *f, ostream& err) { - map > mons; // hostname => mon + map > mons; // hostname => mon for (map::iterator it = mon_metadata.begin(); it != mon_metadata.end(); ++it) { const Metadata& m = it->second; @@ -4978,7 +4978,7 @@ int Monitor::print_nodes(Formatter *f, ostream& err) // not likely though continue; } - mons[hostname->second].push_back(it->first); + mons[hostname->second].push_back(monmap->get_name(it->first)); } dump_services(f, mons, "mon"); -- 2.39.5