From: Josh Durgin Date: Wed, 8 Aug 2012 22:24:57 +0000 (-0700) Subject: MonMap: return error on failure in build_initial X-Git-Tag: v0.50~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=98286b499cf094c67245d8d1b435328e73eee9fa;p=ceph.git MonMap: return error on failure in build_initial 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 --- diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc index 6dd8ec88c5a2..88666cb4cbc8 100644 --- a/src/mon/MonMap.cc +++ b/src/mon/MonMap.cc @@ -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; }