From: Tomek Mrugalski Date: Thu, 23 May 2019 17:38:31 +0000 (+0200) Subject: [#627] The code should no longer throw when obsolete top level entries are present X-Git-Tag: Kea-1.6.0-beta~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=386da50864161baa4a910f21f0627c14b944cf89;p=thirdparty%2Fkea.git [#627] The code should no longer throw when obsolete top level entries are present --- diff --git a/src/lib/process/d_controller.cc b/src/lib/process/d_controller.cc index b20ab3a2bf..362161cf58 100644 --- a/src/lib/process/d_controller.cc +++ b/src/lib/process/d_controller.cc @@ -192,21 +192,21 @@ DControllerBase::checkConfigOnly() { } // Check obsolete or unknown (aka unsupported) objects. - std::list unsupported; for (auto obj : whole_config->mapValue()) { const std::string& app_name = getAppName(); const std::string& obj_name = obj.first; - if ((obj_name == app_name) || (obj_name == "Logging")) { + if (obj_name == app_name) { continue; } - unsupported.push_back(obj_name); - } - if (unsupported.size() == 1) { - isc_throw(InvalidUsage, "Unsupported object '" - << unsupported.front() << "' in config"); - } else if (unsupported.size() > 1) { - isc_throw(InvalidUsage, "Unsupported objects '" - << unsupported.front() << "', ... in config"); + 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("Defining anything in global level besides '" + app_name + + "' is no longer supported."); } // Relocate Logging: if there is a global Logging object takes its