[PATCH 2/3] monmap: iterate over addr_name when printing summary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The rank is now ordered by IP address. We should iterate over
addr_name.

Signed-off-by: Henry C Chang <henry.cy.chang@xxxxxxxxx>
---
 src/mon/MonMap.cc |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc
index 89c6666..69de6a2 100644
--- a/src/mon/MonMap.cc
+++ b/src/mon/MonMap.cc
@@ -45,10 +45,10 @@ void MonMap::print(ostream& out) const
   out << "last_changed " << last_changed << "\n";
   out << "created " << created << "\n";
   unsigned i = 0;
-  for (map<string,entity_addr_t>::const_iterator p = mon_addr.begin();
-       p != mon_addr.end();
+  for (map<entity_addr_t,string>::const_iterator p = addr_name.begin();
+       p != addr_name.end();
        p++)
-    out << i++ << ": " << p->second << " mon." << p->first << "\n";
+    out << i++ << ": " << p->first << " mon." << p->second << "\n";
 }
 
 void MonMap::dump(Formatter *f) const
@@ -59,13 +59,13 @@ void MonMap::dump(Formatter *f) const
   f->dump_stream("created") << created;
   f->open_array_section("mons");
   int i = 0;
-  for (map<string,entity_addr_t>::const_iterator p = mon_addr.begin();
-       p != mon_addr.end();
+  for (map<entity_addr_t,string>::const_iterator p = addr_name.begin();
+       p != addr_name.end();
        ++p, ++i) {
     f->open_object_section("mon");
     f->dump_int("rank", i);
-    f->dump_string("name", p->first);
-    f->dump_stream("addr") << p->second;
+    f->dump_string("name", p->second);
+    f->dump_stream("addr") << p->first;
     f->close_section();
   }
   f->close_section();
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux