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>
// -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;
}