Merge pull request #20820 from guzhongyan/nodels-improve

mon: node ls improvement

Reviewed-by: John Spray <john.spray@redhat.com>
This commit is contained in:
Kefu Chai 2018-04-02 22:06:49 +08:00 committed by GitHub
commit 6a981eb842
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View File

@ -1735,7 +1735,7 @@ int MDSMonitor::print_nodes(Formatter *f)
return r;
}
map<string, list<int> > mdses; // hostname => rank
map<string, list<string> > mdses; // hostname => mds
for (map<mds_gid_t, Metadata>::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");

View File

@ -5020,7 +5020,7 @@ void Monitor::count_metadata(const string& field, Formatter *f)
int Monitor::print_nodes(Formatter *f, ostream& err)
{
map<string, list<int> > mons; // hostname => mon
map<string, list<string> > mons; // hostname => mon
for (map<int, Metadata>::iterator it = mon_metadata.begin();
it != mon_metadata.end(); ++it) {
const Metadata& m = it->second;
@ -5029,7 +5029,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");