Prior to
1a331234e8, only OSDs had the Ceph version in their
metadata (MONs and MDSes didn't). This commit searches for
ceph_version, and if not present just returns an empty string.
Fixes: http://tracker.ceph.com/issues/18764
Signed-off-by: Tim Serong <tserong@suse.com>
// TODO: pick the highest version, and make sure that
// somewhere else (during health reporting?) we are
// indicating to the user if we see mixed versions
- ceph_version = i.second->metadata.at("ceph_version");
+ auto ver_iter = i.second->metadata.find("ceph_version");
+ if (ver_iter != i.second->metadata.end()) {
+ ceph_version = i.second->metadata.at("ceph_version");
+ }
f->open_object_section("service");
f->dump_string("type", str_type);