]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
MDSMap: Update/fix print function.
authorGreg Farnum <gregory.farnum@dreamhost.com>
Sat, 22 Jan 2011 01:43:47 +0000 (17:43 -0800)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Mon, 24 Jan 2011 18:57:51 +0000 (10:57 -0800)
It previously didn't look at standby_for_name unless standby_for_rank
was set!

Also, we now let it print out standby_for_rank on any value that isn't
set to the default (-1), since -2 means something.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/mds/MDSMap.cc

index 9a6a6794cdb432378954cc49a54ac62b72f317d0..957d77d07b5a65545a50f1471699e8229dc35655 100644 (file)
@@ -98,12 +98,12 @@ void MDSMap::print(ostream& out)
        << " seq " << info.state_seq;
     if (info.laggy())
       out << " laggy since " << info.laggy_since;
-    if (info.standby_for_rank >= 0 ||
-       info.standby_for_rank >= 0) {
+    if (info.standby_for_rank != -1 ||
+       !info.standby_for_name.empty()) {
       out << " (standby for";
-      if (info.standby_for_rank >= 0) 
+      //if (info.standby_for_rank >= 0)
        out << " rank " << info.standby_for_rank;
-      if (info.standby_for_name.length())
+      if (!info.standby_for_name.empty())
        out << " '" << info.standby_for_name << "'";
       out << ")";
     }