From a6fab0825f27c3cb0bb93a28abea9cd4d50c9150 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 17 Mar 2017 16:42:31 -0400 Subject: [PATCH] mgr: do not crash if FSMap doesn't have 'addr' metadata Signed-off-by: Sage Weil --- src/mgr/Mgr.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mgr/Mgr.cc b/src/mgr/Mgr.cc index 61b09fe191bb4..f9a513154462c 100644 --- a/src/mgr/Mgr.cc +++ b/src/mgr/Mgr.cc @@ -498,7 +498,8 @@ void Mgr::handle_fs_map(MFSMap* m) // FIXME: nothing stopping old daemons being here, they won't have // addr: need to handle case of pre-ceph-mgr daemons that don't have // the fields we expect - if (metadata->metadata.empty()) { + if (metadata->metadata.empty() || + metadata->metadata.count("addr") == 0) { update = true; } else { auto metadata_addr = metadata->metadata.at("addr"); -- 2.39.5