]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/ConfigMonitor: fix dump when by_type is missing an item
authorSage Weil <sage@redhat.com>
Mon, 5 Mar 2018 18:36:59 +0000 (12:36 -0600)
committerSage Weil <sage@redhat.com>
Tue, 6 Mar 2018 20:44:50 +0000 (14:44 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/ConfigMonitor.cc

index a79149ab1bfe788a2d68cb3a1d410ab138826794..bdf865d63b46f48edc049ed45eeb09bb5e06ee48 100644 (file)
@@ -144,11 +144,14 @@ bool ConfigMonitor::preprocess_command(MonOpRequestRef op)
     list<pair<string,Section*>> sections = {
       make_pair("global", &config_map.global)
     };
-    for (auto& i : config_map.by_type) {
-      sections.push_back(make_pair(i.first, &i.second));
-      auto j = config_map.by_id.lower_bound(i.first);
+    for (string type : { "mon", "mgr", "osd", "mds", "client" }) {
+      auto i = config_map.by_type.find(type);
+      if (i != config_map.by_type.end()) {
+       sections.push_back(make_pair(i->first, &i->second));
+      }
+      auto j = config_map.by_id.lower_bound(type);
       while (j != config_map.by_id.end() &&
-            j->first.find(i.first) == 0) {
+            j->first.find(type) == 0) {
        sections.push_back(make_pair(j->first, &j->second));
        ++j;
       }