]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
MonMap: return error on failure in build_initial
authorJosh Durgin <josh.durgin@inktank.com>
Wed, 8 Aug 2012 22:24:57 +0000 (15:24 -0700)
committerSage Weil <sage@inktank.com>
Fri, 10 Aug 2012 15:59:46 +0000 (08:59 -0700)
If mon_host fails to parse, return an error instead of success.
This avoids failing later on an assert monmap.size() > 0 in the
monmap in MonClient.

Fixes: #2913
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
src/mon/MonMap.cc

index 6dd8ec88c5a21abc047429f07771052026079eb5..88666cb4cbc8e0f7bd070f650ec8e6a82f1d7106 100644 (file)
@@ -265,8 +265,11 @@ int MonMap::build_initial(CephContext *cct, ostream& errout)
   // -m foo?
   if (!conf->mon_host.empty()) {
     int r = build_from_host_list(conf->mon_host, "noname-");
-    if (r < 0)
-      errout << "unable to parse addrs in '" << conf->mon_host << "'" << std::endl;
+    if (r < 0) {
+      errout << "unable to parse addrs in '" << conf->mon_host << "'"
+             << std::endl;
+      return r;
+    }
     return 0;
   }