]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/ConfigMonitor: transition old keys to have global/ prefix
authorSage Weil <sage@redhat.com>
Mon, 20 Jan 2020 22:51:18 +0000 (16:51 -0600)
committerSage Weil <sage@redhat.com>
Wed, 22 Jan 2020 14:27:09 +0000 (08:27 -0600)
Convert keys that were missing the global prefix before to now have them.

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/ConfigMonitor.cc

index ab67b3a90fbd8d0adf998272075ddd13054874a4..0af0acc2a19b52817e1bdf3074cea519baf6fa8f 100644 (file)
@@ -779,6 +779,13 @@ void ConfigMonitor::load_config()
               << dendl;
       pending_cleanup[key] = boost::none;
     } else {
+      if (section_name.empty()) {
+       // we prefer global/$option instead of just $option
+       derr << __func__ << " adding global/ prefix to key '" << key << "'"
+            << dendl;
+       pending_cleanup[key] = boost::none;
+       pending_cleanup["global/"s + key] = it->value();
+      }
       Section *section = &config_map.global;;
       if (section_name.size()) {
        if (section_name.find('.') != std::string::npos) {