Commit 8a4df049 authored by Francis Dupont's avatar Francis Dupont
Browse files

[208-finish-move-logging] Two other cases...

parent f02cbb59
......@@ -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());
......
......@@ -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.
///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment