Skip to content

Commit

Permalink
Merge pull request #20820 from guzhongyan/nodels-improve
Browse files Browse the repository at this point in the history
mon: node ls improvement

Reviewed-by: John Spray <john.spray@redhat.com>
  • Loading branch information
tchaikov committed Apr 2, 2018
2 parents ace8c45 + fcc84ed commit 6a981eb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/mon/MDSMonitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down
4 changes: 2 additions & 2 deletions src/mon/Monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
Expand Down

0 comments on commit 6a981eb

Please sign in to comment.