]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#627] Fix applied in configFromFile() 627-global-entries-accepted
authorTomek Mrugalski <tomasz@isc.org>
Thu, 23 May 2019 18:34:19 +0000 (20:34 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Thu, 23 May 2019 18:45:01 +0000 (20:45 +0200)
src/lib/process/d_controller.cc

index 362161cf5873532f5e5e15d0384b49bbb8e6c77c..f56dfe9a2e7002ab4329ba828ec5387b48d05a6e 100644 (file)
@@ -200,13 +200,13 @@ DControllerBase::checkConfigOnly() {
             }
             if (obj_name == "Logging") {
                 LOG_WARN(dctl_logger, DCTL_CONFIG_DEPRECATED)
-                    .arg("Logging defined in top level. This is 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.");
+                .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
@@ -385,23 +385,21 @@ DControllerBase::configFromFile() {
         }
 
         // Check obsolete or unknown (aka unsupported) objects.
-        std::list<std::string> 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 file "
-                      << config_file);
-        } else if (unsupported.size() > 1) {
-            isc_throw(InvalidUsage, "Unsupported objects '"
-                      << unsupported.front() << "', ... in config file "
-                      << config_file);
+            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