]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[208-move-logging-from-global-objects-to-global-params] Addressed comments
authorFrancis Dupont <fdupont@isc.org>
Wed, 22 May 2019 16:46:31 +0000 (18:46 +0200)
committerFrancis Dupont <fdupont@isc.org>
Wed, 22 May 2019 22:10:24 +0000 (18:10 -0400)
15 files changed:
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/dhcp4_messages.cc
src/bin/dhcp4/dhcp4_messages.h
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp6/ctrl_dhcp6_srv.cc
src/bin/dhcp6/dhcp6_messages.cc
src/bin/dhcp6/dhcp6_messages.h
src/bin/dhcp6/dhcp6_messages.mes
src/bin/dhcp6/dhcp6_parser.yy
src/lib/process/cb_ctl_base.h
src/lib/process/config_base.cc
src/lib/process/d_controller.cc
src/lib/process/process_messages.cc
src/lib/process/process_messages.h
src/lib/process/process_messages.mes

index 1f34a06a187e5889b63f4b10f1b94ab6fc2f7d21..9081571139957f8d01dc3f47ff1c1bf86d247034 100644 (file)
@@ -329,31 +329,18 @@ ControlledDhcpv4Srv::commandConfigSetHandler(const string&,
     // configuration attempts.
     CfgMgr::instance().rollback();
 
-    // Check deprecated, obsolete or unknown objects.
-    set<string> deprecated;
-    set<string> obsolete;
-    set<string> unknown;
+    // Check deprecated, obsolete or unknown (aka unsupported) objects.
+    list<string> unsupported;
     for (auto obj : args->mapValue()) {
         const string& obj_name = obj.first;
         if ((obj_name == "Dhcp4") || (obj_name == "Logging")) {
             continue;
         }
-        if ((obj_name == "Dhcp6") || (obj_name == "DhcpDdns")) {
-            // Candidates for deprecated.
-            continue;
-        }
-        if (obj_name == "Control-agent") {
-            deprecated.insert(obj_name);
-            continue;
-        }
-        if (obj_name == "Netconf") {
-            obsolete.insert(obj_name);
-            continue;
-        }
-        unknown.insert(obj_name);
+        unsupported.push_back(obj_name);
     }
 
-    // Relocate Logging.
+    // Relocate Logging: if there is a global Logging object takes its
+    // loggers entry, move the entry to Dhcp4 and remove now empty Logging.
     Daemon::relocateLogging(args, "Dhcp4");
 
     // Parse the logger configuration explicitly into the staging config.
@@ -366,45 +353,13 @@ ControlledDhcpv4Srv::commandConfigSetHandler(const string&,
     // out what exactly is wrong with the new config in case of problems.
     CfgMgr::instance().getStagingCfg()->applyLoggingCfg();
 
-    // Log deprecated objects.
-    for (auto name : deprecated) {
-        LOG_WARN(dhcp4_logger, DHCP4_CONFIG_DEPRECATED_OBJECT).arg(name);
-    }
-
-    // Log obsolete/unknown objects and return an error.
-    string bad;
-    bool bads = false;
-    for (auto name : obsolete) {
-        LOG_ERROR(dhcp4_logger, DHCP4_CONFIG_OBSOLETE_OBJECT).arg(name);
-        if (bad.empty()) {
-            bad = name;
-        } else {
-            bads = true;
-        }
-    }
-    for (auto name : unknown) {
-        LOG_ERROR(dhcp4_logger, DHCP4_CONFIG_UNKNOWN_OBJECT).arg(name);
-        if (bad.empty()) {
-            bad= name;
-        } else {
-            bads = true;
+    // Log unsupported objects.
+    if (!unsupported.empty()) {
+        for (auto name : unsupported) {
+            LOG_ERROR(dhcp4_logger, DHCP4_CONFIG_UNSUPPORTED_OBJECT).arg(name);
         }
-    }
-    if (!obsolete.empty() || !unknown.empty()) {
-        // Rollback logging.
-        CfgMgr::instance().getCurrentCfg()->applyLoggingCfg();
 
-        // Return a failure response.
-        message = "Unsupported object";
-        if (bads) {
-            message += "s";
-        }
-        message = " '" + bad + "'";
-        if (bads) {
-            message += ", ...";
-        }
-        message += " in config";
-        return (isc::config::createAnswer(status_code, message));
+        // Will return an error in a future version.
     }
 
     // Now we configure the server proper.
index 2454c3adee687477e5026460f76c2969c0687ac3..9e422bc7ad6832499d094a1580daf5ca0165db2b 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Mon Apr 29 2019 17:27
+// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Wed May 22 2019 18:21
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -27,16 +27,14 @@ extern const isc::log::MessageID DHCP4_CLIENT_HOSTNAME_PROCESS = "DHCP4_CLIENT_H
 extern const isc::log::MessageID DHCP4_CLIENT_NAME_PROC_FAIL = "DHCP4_CLIENT_NAME_PROC_FAIL";
 extern const isc::log::MessageID DHCP4_COMMAND_RECEIVED = "DHCP4_COMMAND_RECEIVED";
 extern const isc::log::MessageID DHCP4_CONFIG_COMPLETE = "DHCP4_CONFIG_COMPLETE";
-extern const isc::log::MessageID DHCP4_CONFIG_DEPRECATED_OBJECT = "DHCP4_CONFIG_DEPRECATED_OBJECT";
 extern const isc::log::MessageID DHCP4_CONFIG_FETCH = "DHCP4_CONFIG_FETCH";
 extern const isc::log::MessageID DHCP4_CONFIG_LOAD_FAIL = "DHCP4_CONFIG_LOAD_FAIL";
 extern const isc::log::MessageID DHCP4_CONFIG_NEW_SUBNET = "DHCP4_CONFIG_NEW_SUBNET";
-extern const isc::log::MessageID DHCP4_CONFIG_OBSOLETE_OBJECT = "DHCP4_CONFIG_OBSOLETE_OBJECT";
 extern const isc::log::MessageID DHCP4_CONFIG_OPTION_DUPLICATE = "DHCP4_CONFIG_OPTION_DUPLICATE";
 extern const isc::log::MessageID DHCP4_CONFIG_PACKET_QUEUE = "DHCP4_CONFIG_PACKET_QUEUE";
 extern const isc::log::MessageID DHCP4_CONFIG_RECEIVED = "DHCP4_CONFIG_RECEIVED";
 extern const isc::log::MessageID DHCP4_CONFIG_START = "DHCP4_CONFIG_START";
-extern const isc::log::MessageID DHCP4_CONFIG_UNKNOWN_OBJECT = "DHCP4_CONFIG_UNKNOWN_OBJECT";
+extern const isc::log::MessageID DHCP4_CONFIG_UNSUPPORTED_OBJECT = "DHCP4_CONFIG_UNSUPPORTED_OBJECT";
 extern const isc::log::MessageID DHCP4_CONFIG_UPDATE = "DHCP4_CONFIG_UPDATE";
 extern const isc::log::MessageID DHCP4_DB_RECONNECT_ATTEMPT_FAILED = "DHCP4_DB_RECONNECT_ATTEMPT_FAILED";
 extern const isc::log::MessageID DHCP4_DB_RECONNECT_ATTEMPT_SCHEDULE = "DHCP4_DB_RECONNECT_ATTEMPT_SCHEDULE";
@@ -164,16 +162,14 @@ const char* values[] = {
     "DHCP4_CLIENT_NAME_PROC_FAIL", "%1: failed to process the fqdn or hostname sent by a client: %2",
     "DHCP4_COMMAND_RECEIVED", "received command %1, arguments: %2",
     "DHCP4_CONFIG_COMPLETE", "DHCPv4 server has completed configuration: %1",
-    "DHCP4_CONFIG_DEPRECATED_OBJECT", "DHCPv4 server configuration includes a deprecated object: %1",
     "DHCP4_CONFIG_FETCH", "Fetching configuration data from config backends.",
     "DHCP4_CONFIG_LOAD_FAIL", "configuration error using file: %1, reason: %2",
     "DHCP4_CONFIG_NEW_SUBNET", "a new subnet has been added to configuration: %1",
-    "DHCP4_CONFIG_OBSOLETE_OBJECT", "DHCPv4 server configuration includes an obsolete object: %1",
     "DHCP4_CONFIG_OPTION_DUPLICATE", "multiple options with the code %1 added to the subnet %2",
     "DHCP4_CONFIG_PACKET_QUEUE", "DHCPv4 packet queue info after configuration: %1",
     "DHCP4_CONFIG_RECEIVED", "received configuration %1",
     "DHCP4_CONFIG_START", "DHCPv4 server is processing the following configuration: %1",
-    "DHCP4_CONFIG_UNKNOWN_OBJECT", "DHCPv4 server configuration includes an unknown object: %1",
+    "DHCP4_CONFIG_UNSUPPORTED_OBJECT", "DHCPv4 server configuration includes an unsupported object: %1",
     "DHCP4_CONFIG_UPDATE", "updated configuration received: %1",
     "DHCP4_DB_RECONNECT_ATTEMPT_FAILED", "database reconnect failed: %1",
     "DHCP4_DB_RECONNECT_ATTEMPT_SCHEDULE", "scheduling attempt %1 of %2 in %3 milliseconds",
index 27b8add691a583b601272dc5f9f627c4aaa7e0f5..f1242ce1d1483ebd2bb3593189fa1a49de2ce6db 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Mon Apr 29 2019 17:27
+// File created from ../../../src/bin/dhcp4/dhcp4_messages.mes on Wed May 22 2019 18:21
 
 #ifndef DHCP4_MESSAGES_H
 #define DHCP4_MESSAGES_H
@@ -28,16 +28,14 @@ extern const isc::log::MessageID DHCP4_CLIENT_HOSTNAME_PROCESS;
 extern const isc::log::MessageID DHCP4_CLIENT_NAME_PROC_FAIL;
 extern const isc::log::MessageID DHCP4_COMMAND_RECEIVED;
 extern const isc::log::MessageID DHCP4_CONFIG_COMPLETE;
-extern const isc::log::MessageID DHCP4_CONFIG_DEPRECATED_OBJECT;
 extern const isc::log::MessageID DHCP4_CONFIG_FETCH;
 extern const isc::log::MessageID DHCP4_CONFIG_LOAD_FAIL;
 extern const isc::log::MessageID DHCP4_CONFIG_NEW_SUBNET;
-extern const isc::log::MessageID DHCP4_CONFIG_OBSOLETE_OBJECT;
 extern const isc::log::MessageID DHCP4_CONFIG_OPTION_DUPLICATE;
 extern const isc::log::MessageID DHCP4_CONFIG_PACKET_QUEUE;
 extern const isc::log::MessageID DHCP4_CONFIG_RECEIVED;
 extern const isc::log::MessageID DHCP4_CONFIG_START;
-extern const isc::log::MessageID DHCP4_CONFIG_UNKNOWN_OBJECT;
+extern const isc::log::MessageID DHCP4_CONFIG_UNSUPPORTED_OBJECT;
 extern const isc::log::MessageID DHCP4_CONFIG_UPDATE;
 extern const isc::log::MessageID DHCP4_DB_RECONNECT_ATTEMPT_FAILED;
 extern const isc::log::MessageID DHCP4_DB_RECONNECT_ATTEMPT_SCHEDULE;
index 5eb3141184ba959881e958c33d8fca6f43189f66..40f11675662dce579674ed75f4ec17f15267cda5 100644 (file)
@@ -134,10 +134,6 @@ new configuration. It is output during server startup, and when an updated
 configuration is committed by the administrator.  Additional information
 may be provided.
 
-% DHCP4_CONFIG_DEPRECATED_OBJECT DHCPv4 server configuration includes a deprecated object: %1
-This warning message is issued when the configuration includes a deprecated
-object (i.e. a top level element) which will be ignored.
-
 % DHCP4_CONFIG_FETCH Fetching configuration data from config backends.
 This is an informational message emitted when the DHCPv4 server about to begin
 retrieving configuration data from one or more configuration backends.
@@ -152,10 +148,6 @@ server will continue to use an old configuration.
 This is an informational message reporting that the configuration has
 been extended to include the specified IPv4 subnet.
 
-% DHCP4_CONFIG_OBSOLETE_OBJECT DHCPv4 server configuration includes an obsolete object: %1
-This error message is issued when the configuration includes an obsolete
-object (i.e. a top level element).
-
 % DHCP4_CONFIG_OPTION_DUPLICATE multiple options with the code %1 added to the subnet %2
 This warning message is issued on an attempt to configure multiple options
 with the same option code for a particular subnet. Adding multiple options
@@ -175,8 +167,8 @@ This is a debug message that is issued every time the server receives a
 configuration. That happens at start up and also when a server configuration
 change is committed by the administrator.
 
-% DHCP4_CONFIG_UNKNOWN_OBJECT DHCPv4 server configuration includes an unknown object: %1
-This error message is issued when the configuration includes an unknown
+% DHCP4_CONFIG_UNSUPPORTED_OBJECT DHCPv4 server configuration includes an unsupported object: %1
+This error message is issued when the configuration includes an unsupported
 object (i.e. a top level element).
 
 % DHCP4_CONFIG_UPDATE updated configuration received: %1
index 0b3a916562924f2bfdf6be846b517a4cf6cda7d9..d38ba4433cebe88ff86934853bae4662afc50ea5 100644 (file)
@@ -331,31 +331,18 @@ ControlledDhcpv6Srv::commandConfigSetHandler(const string&,
     // configuration attempts.
     CfgMgr::instance().rollback();
 
-    // Check deprecated, obsolete or unknown objects.
-    set<string> deprecated;
-    set<string> obsolete;
-    set<string> unknown;
+    // Check deprecated, obsolete or unknown (aka unsupported) objects.
+    list<string> unsupported;
     for (auto obj : args->mapValue()) {
         const string& obj_name = obj.first;
         if ((obj_name == "Dhcp6") || (obj_name == "Logging")) {
             continue;
         }
-        if ((obj_name == "Dhcp4") || (obj_name == "DhcpDdns")) {
-            // Candidates for deprecated.
-            continue;
-        }
-        if (obj_name == "Control-agent") {
-            deprecated.insert(obj_name);
-            continue;
-        }
-        if (obj_name == "Netconf") {
-            obsolete.insert(obj_name);
-            continue;
-        }
-        unknown.insert(obj_name);
+        unsupported.push_back(obj_name);
     }
 
-    // Relocate Logging.
+    // Relocate Logging: if there is a global Logging object takes its
+    // loggers entry, move the entry to Dhcp6 and remove now empty Logging.
     Daemon::relocateLogging(args, "Dhcp6");
 
     // Parse the logger configuration explicitly into the staging config.
@@ -368,45 +355,13 @@ ControlledDhcpv6Srv::commandConfigSetHandler(const string&,
     // out what exactly is wrong with the new config in case of problems.
     CfgMgr::instance().getStagingCfg()->applyLoggingCfg();
 
-    // Log deprecated objects.
-    for (auto name : deprecated) {
-        LOG_WARN(dhcp6_logger, DHCP6_CONFIG_DEPRECATED_OBJECT).arg(name);
-    }
-
-    // Log obsolete/unknown objects and return an error.
-    string bad;
-    bool bads = false;
-    for (auto name : obsolete) {
-        LOG_ERROR(dhcp6_logger, DHCP6_CONFIG_OBSOLETE_OBJECT).arg(name);
-        if (bad.empty()) {
-            bad = name;
-        } else {
-            bads = true;
-        }
-    }
-    for (auto name : unknown) {
-        LOG_ERROR(dhcp6_logger, DHCP6_CONFIG_UNKNOWN_OBJECT).arg(name);
-        if (bad.empty()) {
-            bad= name;
-        } else {
-            bads = true;
+    // Log unsupported objects.
+    if (!unsupported.empty()) {
+        for (auto name : unsupported) {
+            LOG_ERROR(dhcp6_logger, DHCP6_CONFIG_UNSUPPORTED_OBJECT).arg(name);
         }
-    }
-    if (!obsolete.empty() || !unknown.empty()) {
-        // Rollback logging.
-        CfgMgr::instance().getCurrentCfg()->applyLoggingCfg();
 
-        // Return a failure response.
-        message = "Unsupported object";
-        if (bads) {
-            message += "s";
-        }
-        message = " '" + bad + "'";
-        if (bads) {
-            message += ", ...";
-        }
-        message += " in config";
-        return (isc::config::createAnswer(status_code, message));
+        // Will return an error in a future version.
     }
 
     // Now we configure the server proper.
index f9186c97ea264404c4d01c706bcd6368fd46be63..b9c5437da68b265e181fb04f82f24acc9459af61 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Tue Apr 30 2019 10:41
+// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Wed May 22 2019 18:12
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -22,13 +22,11 @@ extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED = "DHCP6_CLASS_UNDEFINED"
 extern const isc::log::MessageID DHCP6_CLASS_UNTESTABLE = "DHCP6_CLASS_UNTESTABLE";
 extern const isc::log::MessageID DHCP6_COMMAND_RECEIVED = "DHCP6_COMMAND_RECEIVED";
 extern const isc::log::MessageID DHCP6_CONFIG_COMPLETE = "DHCP6_CONFIG_COMPLETE";
-extern const isc::log::MessageID DHCP6_CONFIG_DEPRECATED_OBJECT = "DHCP6_CONFIG_DEPRECATED_OBJECT";
 extern const isc::log::MessageID DHCP6_CONFIG_LOAD_FAIL = "DHCP6_CONFIG_LOAD_FAIL";
-extern const isc::log::MessageID DHCP6_CONFIG_OBSOLETE_OBJECT = "DHCP6_CONFIG_OBSOLETE_OBJECT";
 extern const isc::log::MessageID DHCP6_CONFIG_PACKET_QUEUE = "DHCP6_CONFIG_PACKET_QUEUE";
 extern const isc::log::MessageID DHCP6_CONFIG_RECEIVED = "DHCP6_CONFIG_RECEIVED";
 extern const isc::log::MessageID DHCP6_CONFIG_START = "DHCP6_CONFIG_START";
-extern const isc::log::MessageID DHCP6_CONFIG_UNKNOWN_OBJECT = "DHCP6_CONFIG_UNKNOWN_OBJECT";
+extern const isc::log::MessageID DHCP6_CONFIG_UNSUPPORTED_OBJECT = "DHCP6_CONFIG_UNSUPPORTED_OBJECT";
 extern const isc::log::MessageID DHCP6_CONFIG_UPDATE = "DHCP6_CONFIG_UPDATE";
 extern const isc::log::MessageID DHCP6_DB_BACKEND_STARTED = "DHCP6_DB_BACKEND_STARTED";
 extern const isc::log::MessageID DHCP6_DB_RECONNECT_ATTEMPT_FAILED = "DHCP6_DB_RECONNECT_ATTEMPT_FAILED";
@@ -165,13 +163,11 @@ const char* values[] = {
     "DHCP6_CLASS_UNTESTABLE", "required class %1 has no test expression",
     "DHCP6_COMMAND_RECEIVED", "received command %1, arguments: %2",
     "DHCP6_CONFIG_COMPLETE", "DHCPv6 server has completed configuration: %1",
-    "DHCP6_CONFIG_DEPRECATED_OBJECT", "DHCPv6 server configuration includes a deprecated object: %1",
     "DHCP6_CONFIG_LOAD_FAIL", "configuration error using file: %1, reason: %2",
-    "DHCP6_CONFIG_OBSOLETE_OBJECT", "DHCPv6 server configuration includes an obsolete object: %1",
     "DHCP6_CONFIG_PACKET_QUEUE", "DHCPv6 packet queue info after configuration: %1",
     "DHCP6_CONFIG_RECEIVED", "received configuration: %1",
     "DHCP6_CONFIG_START", "DHCPv6 server is processing the following configuration: %1",
-    "DHCP6_CONFIG_UNKNOWN_OBJECT", "DHCPv6 server configuration includes an unknown object: %1",
+    "DHCP6_CONFIG_UNSUPPORTED_OBJECT", "DHCPv6 server configuration includes an unsupported object: %1",
     "DHCP6_CONFIG_UPDATE", "updated configuration received: %1",
     "DHCP6_DB_BACKEND_STARTED", "lease database started (type: %1, name: %2)",
     "DHCP6_DB_RECONNECT_ATTEMPT_FAILED", "database reconnect failed: %1",
index 73554417012643edec20350620a499d65308ed9c..604a44edc94ab31d04eba434b58a72d745b9d29e 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Tue Apr 30 2019 10:41
+// File created from ../../../src/bin/dhcp6/dhcp6_messages.mes on Wed May 22 2019 18:12
 
 #ifndef DHCP6_MESSAGES_H
 #define DHCP6_MESSAGES_H
@@ -23,13 +23,11 @@ extern const isc::log::MessageID DHCP6_CLASS_UNDEFINED;
 extern const isc::log::MessageID DHCP6_CLASS_UNTESTABLE;
 extern const isc::log::MessageID DHCP6_COMMAND_RECEIVED;
 extern const isc::log::MessageID DHCP6_CONFIG_COMPLETE;
-extern const isc::log::MessageID DHCP6_CONFIG_DEPRECATED_OBJECT;
 extern const isc::log::MessageID DHCP6_CONFIG_LOAD_FAIL;
-extern const isc::log::MessageID DHCP6_CONFIG_OBSOLETE_OBJECT;
 extern const isc::log::MessageID DHCP6_CONFIG_PACKET_QUEUE;
 extern const isc::log::MessageID DHCP6_CONFIG_RECEIVED;
 extern const isc::log::MessageID DHCP6_CONFIG_START;
-extern const isc::log::MessageID DHCP6_CONFIG_UNKNOWN_OBJECT;
+extern const isc::log::MessageID DHCP6_CONFIG_UNSUPPORTED_OBJECT;
 extern const isc::log::MessageID DHCP6_CONFIG_UPDATE;
 extern const isc::log::MessageID DHCP6_DB_BACKEND_STARTED;
 extern const isc::log::MessageID DHCP6_DB_RECONNECT_ATTEMPT_FAILED;
index 47dae7542208c85930d61764895b5afa1066b064..d2c202b78795565473e4d3dbdba966aaaa2246e8 100644 (file)
@@ -98,20 +98,12 @@ new configuration. it is output during server startup, and when an updated
 configuration is committed by the administrator.  Additional information
 may be provided.
 
-% DHCP6_CONFIG_DEPRECATED_OBJECT DHCPv6 server configuration includes a deprecated object: %1
-This warning message is issued when the configuration includes a deprecated
-object (i.e. a top level element) which will be ignored.
-
 % DHCP6_CONFIG_LOAD_FAIL configuration error using file: %1, reason: %2
 This error message indicates that the DHCPv6 configuration has failed.
 If this is an initial configuration (during server's startup) the server
 will fail to start. If this is a dynamic reconfiguration attempt the
 server will continue to use an old configuration.
 
-% DHCP6_CONFIG_OBSOLETE_OBJECT DHCPv6 server configuration includes an obsolete object: %1
-This error message is issued when the configuration includes an obsolete
-object (i.e. a top level element).
-
 % DHCP6_CONFIG_PACKET_QUEUE DHCPv6 packet queue info after configuration: %1
 This informational message is emitted during DHCPv6 server configuration,
 immediately after configuring the DHCPv6 packet queue.  The information
@@ -126,8 +118,8 @@ This is a debug message that is issued every time the server receives a
 configuration. That happens start up and also when a server configuration
 change is committed by the administrator.
 
-% DHCP6_CONFIG_UNKNOWN_OBJECT DHCPv6 server configuration includes an unknown object: %1
-This error message is issued when the configuration includes an unknown
+% DHCP6_CONFIG_UNSUPPORTED_OBJECT DHCPv6 server configuration includes an unsupported object: %1
+This error message is issued when the configuration includes an unsupported
 object (i.e. a top level element).
 
 % DHCP6_CONFIG_UPDATE updated configuration received: %1
index 4b2d4b1045574dc74907d91814902f922762eab9..418d8989724cc5a0ffdbd67f1d705fe1fcaf6af8 100644 (file)
@@ -476,8 +476,8 @@ global_param: data_directory
             | server_tag
             | reservation_mode
             | calculate_tee_times
-            | t1_percent 
-            | t2_percent 
+            | t1_percent
+            | t2_percent
             | loggers
             | unknown_map_entry
             ;
@@ -1098,8 +1098,8 @@ subnet6_param: preferred_lifetime
              | user_context
              | comment
              | calculate_tee_times
-             | t1_percent 
-             | t2_percent 
+             | t1_percent
+             | t2_percent
              | unknown_map_entry
              ;
 
@@ -1220,8 +1220,8 @@ shared_network_param: name
                     | user_context
                     | comment
                     | calculate_tee_times
-                    | t1_percent 
-                    | t2_percent 
+                    | t1_percent
+                    | t2_percent
                     | unknown_map_entry
                     ;
 
index 223828c1f0f4ac9338ab1c7d1b887b79d88acfdb..ad7a748e0d3c1ec673ff1980578f899f6f58b864 100644 (file)
@@ -324,7 +324,7 @@ protected:
     ///
     /// If the collection of audit entries is empty, this method simply
     /// returns without updating the timestamp.
-    /// 
+    ///
     /// @param Reference to the collection of the fetched audit entries.
     void updateLastAuditEntryTime(const db::AuditEntryCollection& audit_entries) {
         // Do nothing if there are no audit entries. It is the case if
index 378acd19c10d8796b05bf62cc4cb457b7f37e3f6..da835dd4f5ca6fa0e0c01f65368bd0a0bd14d590 100644 (file)
@@ -128,11 +128,6 @@ ConfigBase::toElement() const {
         result->set("server-tag", Element::create(server_tag_.get()));
     }
 
-    // Note this comment below is obsolete...
-    // We do NOT output ConfigControlInfo here, as it is not a
-    // top level element, but rather belongs within the process
-    // element.
-
     return (result);
 }
 
index 40ed28f55795aafa537da4a050a6eea03444ca01..b20ab3a2bf3ffa08d52f6dc50253d38d30a6d41f 100644 (file)
@@ -191,36 +191,27 @@ DControllerBase::checkConfigOnly() {
                       " include not map '" << getAppName() << "' entry");
         }
 
-        // Check obsolete or unknown objects.
-        std::set<std::string> unsupported;
+        // 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")) {
                 continue;
             }
-            if ((obj_name == "Dhcp4") || (obj_name == "Dhcp6") ||
-                (obj_name == "Control-agent") || (obj_name == "Netconf")) {
-                if ((app_name == "DhcpDdns") ||
-                    (app_name == "Control-agent")) {
-                    continue;
-                }
-                if (app_name == "Netconf") {
-                    unsupported.insert(obj_name);
-                    continue;
-                }
-            }
-            unsupported.insert(obj_name);
+            unsupported.push_back(obj_name);
         }
         if (unsupported.size() == 1) {
             isc_throw(InvalidUsage, "Unsupported object '"
-                      << *unsupported.begin() << "' in config");
+                      << unsupported.front() << "' in config");
         } else if (unsupported.size() > 1) {
             isc_throw(InvalidUsage, "Unsupported objects '"
-                      << *unsupported.begin() << "', ... in config");
+                      << unsupported.front() << "', ... in config");
         }
 
-        // Relocate Logging.
+        // 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());
 
         // Get an application process object.
@@ -393,11 +384,29 @@ DControllerBase::configFromFile() {
                       " include not map '" << getAppName() << "' entry");
         }
 
-        // Check obsolete objects.
-
-        // Check deprecated objects.
+        // 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")) {
+                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);
+        }
 
-        // Relocate Logging.
+        // 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());
 
         // Let's configure logging before applying the configuration,
@@ -415,10 +424,6 @@ DControllerBase::configFromFile() {
         // case of problems.
         storage->applyLoggingCfg();
 
-        // Log deprecated objects.
-
-        // Log obsolete objects and raise an error.
-
         answer = updateConfig(module_config);
         // In all cases the right logging configuration is in the context.
         process_->getCfgMgr()->getContext()->applyLoggingCfg();
index aa4e382ae4f6a83e0147cd3006199d67cbf9f121..6812f2b0970bd1a915a7a5ede8fd798d7057b5aa 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/lib/process/process_messages.mes on Mon Apr 29 2019 17:28
+// File created from ../../../src/lib/process/process_messages.mes on Wed May 22 2019 18:44
 
 #include <cstddef>
 #include <log/message_types.h>
@@ -19,10 +19,8 @@ extern const isc::log::MessageID DCTL_CONFIG_DEPRECATED = "DCTL_CONFIG_DEPRECATE
 extern const isc::log::MessageID DCTL_CONFIG_FETCH = "DCTL_CONFIG_FETCH";
 extern const isc::log::MessageID DCTL_CONFIG_FILE_LOAD_FAIL = "DCTL_CONFIG_FILE_LOAD_FAIL";
 extern const isc::log::MessageID DCTL_CONFIG_LOAD_FAIL = "DCTL_CONFIG_LOAD_FAIL";
-extern const isc::log::MessageID DCTL_CONFIG_OBSOLETE_OBJECT = "DCTL_CONFIG_OBSOLETE_OBJECT";
 extern const isc::log::MessageID DCTL_CONFIG_START = "DCTL_CONFIG_START";
 extern const isc::log::MessageID DCTL_CONFIG_STUB = "DCTL_CONFIG_STUB";
-extern const isc::log::MessageID DCTL_CONFIG_UNKNOWN_OBJECT = "DCTL_CONFIG_UNKNOWN_OBJECT";
 extern const isc::log::MessageID DCTL_CONFIG_UPDATE = "DCTL_CONFIG_UPDATE";
 extern const isc::log::MessageID DCTL_INIT_PROCESS = "DCTL_INIT_PROCESS";
 extern const isc::log::MessageID DCTL_INIT_PROCESS_FAIL = "DCTL_INIT_PROCESS_FAIL";
@@ -58,10 +56,8 @@ const char* values[] = {
     "DCTL_CONFIG_FETCH", "Fetching configuration data from config backends.",
     "DCTL_CONFIG_FILE_LOAD_FAIL", "%1 reason: %2",
     "DCTL_CONFIG_LOAD_FAIL", "%1 configuration failed to load: %2",
-    "DCTL_CONFIG_OBSOLETE_OBJECT", "server configuration includes an obsolete object: %1",
     "DCTL_CONFIG_START", "parsing new configuration: %1",
     "DCTL_CONFIG_STUB", "%1 configuration stub handler called",
-    "DCTL_CONFIG_UNKNOWN_OBJECT", "server configuration includes an unknown object: %1",
     "DCTL_CONFIG_UPDATE", "%1 updated configuration received: %2",
     "DCTL_INIT_PROCESS", "%1 initializing the application",
     "DCTL_INIT_PROCESS_FAIL", "%1 application initialization failed: %2",
index 2525423e66fa0497f9fe81c139efd1ce307c1dfa..a2f58ef1b18d518087c63c2b54b10eb0609659fb 100644 (file)
@@ -1,4 +1,4 @@
-// File created from ../../../src/lib/process/process_messages.mes on Mon Apr 29 2019 17:28
+// File created from ../../../src/lib/process/process_messages.mes on Wed May 22 2019 18:44
 
 #ifndef PROCESS_MESSAGES_H
 #define PROCESS_MESSAGES_H
@@ -20,10 +20,8 @@ extern const isc::log::MessageID DCTL_CONFIG_DEPRECATED;
 extern const isc::log::MessageID DCTL_CONFIG_FETCH;
 extern const isc::log::MessageID DCTL_CONFIG_FILE_LOAD_FAIL;
 extern const isc::log::MessageID DCTL_CONFIG_LOAD_FAIL;
-extern const isc::log::MessageID DCTL_CONFIG_OBSOLETE_OBJECT;
 extern const isc::log::MessageID DCTL_CONFIG_START;
 extern const isc::log::MessageID DCTL_CONFIG_STUB;
-extern const isc::log::MessageID DCTL_CONFIG_UNKNOWN_OBJECT;
 extern const isc::log::MessageID DCTL_CONFIG_UPDATE;
 extern const isc::log::MessageID DCTL_INIT_PROCESS;
 extern const isc::log::MessageID DCTL_INIT_PROCESS_FAIL;
index 50cbfeca51145e9c0772e8b76124ac961c8f3b21..fe39c53bb3b828d46e31ec5df96e7d8a0ab520f2 100644 (file)
@@ -66,10 +66,6 @@ This critical error message indicates that the initial application
 configuration has failed. The service will start, but will not
 process requests until the configuration has been corrected.
 
-% DCTL_CONFIG_OBSOLETE_OBJECT server configuration includes an obsolete object: %1
-This error message is issued when the configuration includes an obsolete
-object (i.e. a top level element).
-
 % DCTL_CONFIG_START parsing new configuration: %1
 A debug message indicating that the application process has received an
 updated configuration and has passed it to its configuration manager
@@ -79,10 +75,6 @@ for parsing.
 This debug message is issued when the dummy handler for configuration
 events is called.  This only happens during initial startup.
 
-% DCTL_CONFIG_UNKNOWN_OBJECT server configuration includes an unknown object: %1
-This error message is issued when the configuration includes an unknown
-object (i.e. a top level element).
-
 % DCTL_CONFIG_UPDATE %1 updated configuration received: %2
 A debug message indicating that the controller has received an
 updated configuration from the Kea configuration system.