]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[208-finish-move-logging] Two other cases...
authorFrancis Dupont <fdupont@isc.org>
Tue, 16 Jul 2019 14:46:25 +0000 (16:46 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 16 Jul 2019 14:50:49 +0000 (16:50 +0200)
src/lib/process/d_controller.cc
src/lib/process/d_controller.h

index 735a9181ba953bec370e75925bd21a81b6fb59fa..f94504d74f525107ba7157d65263939f882cef3b 100644 (file)
@@ -191,28 +191,8 @@ DControllerBase::checkConfigOnly() {
                       " include not map '" << getAppName() << "' entry");
         }
 
-        // Check obsolete or unknown (aka unsupported) objects.
-        for (auto obj : whole_config->mapValue()) {
-            const std::string& app_name = getAppName();
-            const std::string& obj_name = obj.first;
-            if (obj_name == app_name) {
-                continue;
-            }
-            if (obj_name == "Logging") {
-                LOG_WARN(dctl_logger, DCTL_CONFIG_DEPRECATED)
-                    .arg("'Logging' defined in top level. This is deprecated."
-                         " Please define it in the '" + app_name + "' scope.");
-                continue;
-            }
-            LOG_WARN(dctl_logger, DCTL_CONFIG_DEPRECATED)
-                .arg("'" + obj_name + "', defining anything in global level besides '"
-                     + app_name + "' is no longer supported.");
-        }
-
-        // Relocate Logging: if there is a global Logging object takes its
-        // loggers entry, move the entry to AppName object and remove
-        // now empty Logging.
-        Daemon::relocateLogging(whole_config, getAppName());
+        // Handle other (i.e. not application name) objects (e.g. Logging).
+        handleOtherObjects(whole_config);
 
         // Get an application process object.
         initProcess();
@@ -384,28 +364,8 @@ DControllerBase::configFromFile() {
                       " include not map '" << getAppName() << "' entry");
         }
 
-        // Check obsolete or unknown (aka unsupported) objects.
-        for (auto obj : whole_config->mapValue()) {
-            const std::string& app_name = getAppName();
-            const std::string& obj_name = obj.first;
-            if (obj_name == app_name) {
-                continue;
-            }
-            if (obj_name == "Logging") {
-                LOG_WARN(dctl_logger, DCTL_CONFIG_DEPRECATED)
-                    .arg("Logging defined in top level. This is deprecated."
-                         " Please define it in the '" + app_name + "' scope.");
-                continue;
-            }
-            LOG_WARN(dctl_logger, DCTL_CONFIG_DEPRECATED)
-                .arg("'" + obj_name + "', defining anything in global level besides '"
-                     + app_name + "' is no longer supported.");
-        }
-
-        // Relocate Logging: if there is a global Logging object takes its
-        // loggers entry, move the entry to AppName object and remove
-        // now empty Logging.
-        Daemon::relocateLogging(whole_config, getAppName());
+        // Handle other (i.e. not application name) objects (e.g. Logging).
+        handleOtherObjects(whole_config);
 
         // Let's configure logging before applying the configuration,
         // so we can log things during configuration process.
@@ -552,12 +512,6 @@ DControllerBase::handleOtherObjects(ConstElementPtr args) {
     // loggers entry, move the entry to AppName object and remove
     // now empty Logging.
     Daemon::relocateLogging(args, app_name);
-
-    // We are starting the configuration process so we should remove any
-    // staging configuration that has been created during previous
-    // configuration attempts.
-    // We're not using cfgmgr to store logging information anymore.
-    // isc::dhcp::CfgMgr::instance().rollback();
 }
 
 ConstElementPtr
@@ -590,6 +544,12 @@ DControllerBase::configTestHandler(const std::string&, ConstElementPtr args) {
     // Handle other (i.e. not application name) objects (e.g. Logging).
     handleOtherObjects(args);
 
+    // We are starting the configuration process so we should remove any
+    // staging configuration that has been created during previous
+    // configuration attempts.
+    // We're not using cfgmgr to store logging information anymore.
+    // isc::dhcp::CfgMgr::instance().rollback();
+
     // Now we check the server proper.
     return (checkConfig(module_config));
 }
@@ -632,6 +592,12 @@ DControllerBase::configSetHandler(const std::string&, ConstElementPtr args) {
         // Handle other (i.e. not application name) objects (e.g. Logging).
         handleOtherObjects(args);
 
+        // We are starting the configuration process so we should remove any
+        // staging configuration that has been created during previous
+        // configuration attempts.
+        // We're not using cfgmgr to store logging information anymore.
+        // isc::dhcp::CfgMgr::instance().rollback();
+
         // Temporary storage for logging configuration
         ConfigPtr storage(new ConfigBase());
 
index 8093bcf4bad8b64a463d59e993c67fd3070ebb2e..339845f59127ffe984a737e81d99a265837cc925 100644 (file)
@@ -603,7 +603,7 @@ protected:
 
     /// @brief Deals with other (i.e. not application name) global objects.
     ///
-    /// Code shared between config-test and config-set command handlers:
+    /// Code shared between configuration handlers:
     ///  - check obsolete or unknown (aka unsupported) objects.
     ///  - relocate Logging.
     ///