diff options
author | Francis Dupont <fdupont@isc.org> | 2019-07-16 16:46:25 +0200 |
---|---|---|
committer | Francis Dupont <fdupont@isc.org> | 2019-07-16 16:50:49 +0200 |
commit | 8a4df04930102487df744e190f9d5cb48da2aeec (patch) | |
tree | 90791d52e8817879eea6f4381fadf6a33a426bb3 | |
parent | [208-finish-move-logging] Addressed comment (diff) | |
download | kea-8a4df04930102487df744e190f9d5cb48da2aeec.tar.xz kea-8a4df04930102487df744e190f9d5cb48da2aeec.zip |
[208-finish-move-logging] Two other cases...
-rw-r--r-- | src/lib/process/d_controller.cc | 66 | ||||
-rw-r--r-- | src/lib/process/d_controller.h | 2 |
2 files changed, 17 insertions, 51 deletions
diff --git a/src/lib/process/d_controller.cc b/src/lib/process/d_controller.cc index 735a9181ba..f94504d74f 100644 --- a/src/lib/process/d_controller.cc +++ b/src/lib/process/d_controller.cc @@ -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()); diff --git a/src/lib/process/d_controller.h b/src/lib/process/d_controller.h index 8093bcf4ba..339845f591 100644 --- a/src/lib/process/d_controller.h +++ b/src/lib/process/d_controller.h @@ -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. /// |