]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2601] make NETCONF_SUBSCRIBE_NOTIFICATIONS_FAILED a warning
authorAndrei Pavel <andrei@isc.org>
Tue, 1 Nov 2022 08:10:12 +0000 (10:10 +0200)
committerRazvan Becheriu <razvan@isc.org>
Fri, 25 Nov 2022 16:15:33 +0000 (18:15 +0200)
src/bin/netconf/netconf.cc
src/bin/netconf/netconf_messages.cc
src/bin/netconf/netconf_messages.h
src/bin/netconf/netconf_messages.mes
src/bin/netconf/tests/parser_unittests.cc

index 7c9ec92e80f524d258de108553eae3b01290f383..4f7af1a2d3aca699a6470279a0c64ea5d509acc5 100644 (file)
@@ -494,7 +494,7 @@ NetconfAgent::subscribeToNotifications(const CfgServersMapPair& service_pair) {
         ostringstream msg;
         msg << "event notification subscription for model " << model <<
             " failed with: " << ex.what();
-        LOG_ERROR(netconf_logger, NETCONF_SUBSCRIBE_NOTIFICATIONS_FAILED)
+        LOG_WARN(netconf_logger, NETCONF_NOT_SUBSCRIBED_TO_NOTIFICATIONS)
             .arg(server)
             .arg(configuration->getModel())
             .arg(msg.str());
index 6d0d77d02b2082ac4302999ad0a3e718ff86b6b6..c1913ae88979f3283be01dce577cb4a273011214 100644 (file)
@@ -23,6 +23,7 @@ extern const isc::log::MessageID NETCONF_MODULE_MISSING_WARN = "NETCONF_MODULE_M
 extern const isc::log::MessageID NETCONF_MODULE_REVISION_ERR = "NETCONF_MODULE_REVISION_ERR";
 extern const isc::log::MessageID NETCONF_MODULE_REVISION_WARN = "NETCONF_MODULE_REVISION_WARN";
 extern const isc::log::MessageID NETCONF_NOTIFICATION_RECEIVED = "NETCONF_NOTIFICATION_RECEIVED";
+extern const isc::log::MessageID NETCONF_NOT_SUBSCRIBED_TO_NOTIFICATIONS = "NETCONF_NOT_SUBSCRIBED_TO_NOTIFICATIONS";
 extern const isc::log::MessageID NETCONF_RUN_EXIT = "NETCONF_RUN_EXIT";
 extern const isc::log::MessageID NETCONF_SET_CONFIG = "NETCONF_SET_CONFIG";
 extern const isc::log::MessageID NETCONF_SET_CONFIG_FAILED = "NETCONF_SET_CONFIG_FAILED";
@@ -31,7 +32,6 @@ extern const isc::log::MessageID NETCONF_STARTED = "NETCONF_STARTED";
 extern const isc::log::MessageID NETCONF_SUBSCRIBE_CONFIG = "NETCONF_SUBSCRIBE_CONFIG";
 extern const isc::log::MessageID NETCONF_SUBSCRIBE_CONFIG_FAILED = "NETCONF_SUBSCRIBE_CONFIG_FAILED";
 extern const isc::log::MessageID NETCONF_SUBSCRIBE_NOTIFICATIONS = "NETCONF_SUBSCRIBE_NOTIFICATIONS";
-extern const isc::log::MessageID NETCONF_SUBSCRIBE_NOTIFICATIONS_FAILED = "NETCONF_SUBSCRIBE_NOTIFICATIONS_FAILED";
 extern const isc::log::MessageID NETCONF_UPDATE_CONFIG = "NETCONF_UPDATE_CONFIG";
 extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_COMPLETED = "NETCONF_UPDATE_CONFIG_COMPLETED";
 extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_FAILED = "NETCONF_UPDATE_CONFIG_FAILED";
@@ -42,8 +42,8 @@ extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_FAILED = "NETCONF_VALID
 extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_REJECTED = "NETCONF_VALIDATE_CONFIG_REJECTED";
 extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_STARTED = "NETCONF_VALIDATE_CONFIG_STARTED";
 
-}  // namespace netconf
-}  // namespace isc
+} // namespace netconf
+} // namespace isc
 
 namespace {
 
@@ -51,28 +51,28 @@ const char* values[] = {
     "NETCONF_BOOT_UPDATE_COMPLETED", "Boot-update configuration completed for server %1",
     "NETCONF_CONFIG_CHANGED_DETAIL", "YANG configuration changed: %1",
     "NETCONF_CONFIG_CHANGE_EVENT", "Received YANG configuration change %1 event",
-    "NETCONF_CONFIG_CHECK_FAIL", "Netconf configuration check failed: %1",
-    "NETCONF_CONFIG_FAIL", "Netconf configuration failed: %1",
-    "NETCONF_CONFIG_SYNTAX_WARNING", "Netconf configuration syntax warning: %1",
+    "NETCONF_CONFIG_CHECK_FAIL", "NETCONF configuration check failed: %1",
+    "NETCONF_CONFIG_FAIL", "NETCONF configuration failed: %1",
+    "NETCONF_CONFIG_SYNTAX_WARNING", "NETCONF configuration syntax warning: %1",
     "NETCONF_FAILED", "application experienced a fatal error: %1",
     "NETCONF_GET_CONFIG", "got configuration from %1 server: %2",
     "NETCONF_GET_CONFIG_FAILED", "getting configuration from %1 server failed: %2",
     "NETCONF_GET_CONFIG_STARTED", "getting configuration from %1 server",
-    "NETCONF_LOG_CHANGE_FAIL", "Netconf configuration change logging failed: %1",
+    "NETCONF_LOG_CHANGE_FAIL", "NETCONF configuration change logging failed: %1",
     "NETCONF_MODULE_MISSING_ERR", "Missing essential module %1 in sysrepo",
     "NETCONF_MODULE_MISSING_WARN", "Missing module %1 in sysrepo",
     "NETCONF_MODULE_REVISION_ERR", "Essential module %1 does NOT have the right revision: expected %2, got %3",
     "NETCONF_MODULE_REVISION_WARN", "Module %1 does NOT have the right revision: expected %2, got %3",
     "NETCONF_NOTIFICATION_RECEIVED", "Received notification of type %1 for module %1: %2",
+    "NETCONF_NOT_SUBSCRIBED_TO_NOTIFICATIONS", "subscribing to notifications for %1 server with %2 module failed: %3",
     "NETCONF_RUN_EXIT", "application is exiting the event loop",
     "NETCONF_SET_CONFIG", "set configuration to %1 server: %2",
     "NETCONF_SET_CONFIG_FAILED", "setting configuration to %1 server failed: %2",
     "NETCONF_SET_CONFIG_STARTED", "setting configuration to %1 server",
-    "NETCONF_STARTED", "Netconf (version %1) started",
+    "NETCONF_STARTED", "kea-netconf (version %1) started",
     "NETCONF_SUBSCRIBE_CONFIG", "subscribing configuration changes for %1 server with %2 module",
     "NETCONF_SUBSCRIBE_CONFIG_FAILED", "subscribe configuration changes for %1 server with %2 module failed: %3",
     "NETCONF_SUBSCRIBE_NOTIFICATIONS", "subscribing to notifications for %1 server with %2 module",
-    "NETCONF_SUBSCRIBE_NOTIFICATIONS_FAILED", "subscribing to notifications for %1 server with %2 module failed: %3",
     "NETCONF_UPDATE_CONFIG", "updating configuration with %1 server: %2",
     "NETCONF_UPDATE_CONFIG_COMPLETED", "completed updating configuration for %1 server",
     "NETCONF_UPDATE_CONFIG_FAILED", "updating configuration with %1 server: %2",
@@ -87,5 +87,5 @@ const char* values[] = {
 
 const isc::log::MessageInitializer initializer(values);
 
-}  // Anonymous namespace
+} // Anonymous namespace
 
index 720de61e07a1ef4c57aaceb2e4cf34b4a3dd18b4..594c0c85390b127cf3b2a56d31226d3ec0517e77 100644 (file)
@@ -24,6 +24,7 @@ extern const isc::log::MessageID NETCONF_MODULE_MISSING_WARN;
 extern const isc::log::MessageID NETCONF_MODULE_REVISION_ERR;
 extern const isc::log::MessageID NETCONF_MODULE_REVISION_WARN;
 extern const isc::log::MessageID NETCONF_NOTIFICATION_RECEIVED;
+extern const isc::log::MessageID NETCONF_NOT_SUBSCRIBED_TO_NOTIFICATIONS;
 extern const isc::log::MessageID NETCONF_RUN_EXIT;
 extern const isc::log::MessageID NETCONF_SET_CONFIG;
 extern const isc::log::MessageID NETCONF_SET_CONFIG_FAILED;
@@ -32,7 +33,6 @@ extern const isc::log::MessageID NETCONF_STARTED;
 extern const isc::log::MessageID NETCONF_SUBSCRIBE_CONFIG;
 extern const isc::log::MessageID NETCONF_SUBSCRIBE_CONFIG_FAILED;
 extern const isc::log::MessageID NETCONF_SUBSCRIBE_NOTIFICATIONS;
-extern const isc::log::MessageID NETCONF_SUBSCRIBE_NOTIFICATIONS_FAILED;
 extern const isc::log::MessageID NETCONF_UPDATE_CONFIG;
 extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_COMPLETED;
 extern const isc::log::MessageID NETCONF_UPDATE_CONFIG_FAILED;
@@ -43,7 +43,7 @@ extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_FAILED;
 extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_REJECTED;
 extern const isc::log::MessageID NETCONF_VALIDATE_CONFIG_STARTED;
 
-}  // namespace netconf
-}  // namespace isc
+} // namespace netconf
+} // namespace isc
 
 #endif // NETCONF_MESSAGES_H
index 7883c1d8a89ad6c411033f2214a13a9e2617658d..178e1a2432cbbe7d6fb61a4ed3ec1c7aa116398d 100644 (file)
@@ -8,7 +8,7 @@ $NAMESPACE isc::netconf
 
 % NETCONF_BOOT_UPDATE_COMPLETED Boot-update configuration completed for server %1
 This informational message is issued when the initial configuration
-was retrieved from Netconf and successfully applied to Kea server.
+was retrieved using NETCONF and successfully applied to Kea server.
 
 % NETCONF_CONFIG_CHANGED_DETAIL YANG configuration changed: %1
 This debug message indicates a YANG configuration change. The format
@@ -16,43 +16,43 @@ is the change operation (created, modified, deleted or moved) followed
 by xpaths and values of old and new nodes.
 
 % NETCONF_CONFIG_CHANGE_EVENT Received YANG configuration change %1 event
-This informational message is issued when Netconf receives a YANG
+This informational message is issued when kea-netconf receives a YANG
 configuration change event. The type of event is printed.
 
-% NETCONF_CONFIG_CHECK_FAIL Netconf configuration check failed: %1
-This error message indicates that Netconf had failed configuration
+% NETCONF_CONFIG_CHECK_FAIL NETCONF configuration check failed: %1
+This error message indicates that kea-netconf had failed configuration
 check. Details are provided. Additional details may be available
 in earlier log entries, possibly on lower levels.
 
-% NETCONF_CONFIG_FAIL Netconf configuration failed: %1
-This error message indicates that Netconf had failed configuration
+% NETCONF_CONFIG_FAIL NETCONF configuration failed: %1
+This error message indicates that kea-netconf had failed configuration
 attempt. Details are provided. Additional details may be available
 in earlier log entries, possibly on lower levels.
 
-% NETCONF_CONFIG_SYNTAX_WARNING Netconf configuration syntax warning: %1
-This warning message indicates that the Netconf configuration had a minor
+% NETCONF_CONFIG_SYNTAX_WARNING NETCONF configuration syntax warning: %1
+This warning message indicates that the NETCONF configuration had a minor
 syntax error. The error was displayed and the configuration parsing resumed.
 
 % NETCONF_FAILED application experienced a fatal error: %1
-This is a fatal error message issued when the Netconf application
+This is a fatal error message issued when kea-netconf
 got an unrecoverable error from within the event loop.
 
 % NETCONF_GET_CONFIG got configuration from %1 server: %2
-This debug message indicates that Netconf got the configuration from a
+This debug message indicates that kea-netconf got the configuration from a
 Kea server. The server name and the retrieved configuration are printed.
 
 % NETCONF_GET_CONFIG_FAILED getting configuration from %1 server failed: %2
-The error message indicates that Netconf got an error getting the
+The error message indicates that kea-netconf got an error getting the
 configuration from a Kea server. Make sure that the server is up and
 running, has appropriate control socket defined and that the controls
 socket configuration on the server matches that of kea-netconf. The
 name of the server and the error are printed.
 
 % NETCONF_GET_CONFIG_STARTED getting configuration from %1 server
-This informational message indicates that Netconf is trying to get the
+This informational message indicates that kea-netconf is trying to get the
 configuration from a Kea server.
 
-% NETCONF_LOG_CHANGE_FAIL Netconf configuration change logging failed: %1
+% NETCONF_LOG_CHANGE_FAIL NETCONF configuration change logging failed: %1
 The warning message indicates that the configuration change logging
 encountered an unexpected condition. Details of it will be logged.
 
@@ -75,6 +75,13 @@ This warning message indicates that a module used by Kea is not at the
 right revision in the sysrepo repository. The name, expected and
 available revisions of the module are printed.
 
+% NETCONF_NOT_SUBSCRIBED_TO_NOTIFICATIONS subscribing to notifications for %1 server with %2 module failed: %3
+The warning message indicates that kea-netconf got an error subscribing to
+notifications for a Kea server. The most probable cause is probably that the
+model that kea-netconf subscribed to does not have any notification nodes, but
+there may be other more unxpected causes as well.
+The server name, module name and the error are printed.
+
 % NETCONF_NOTIFICATION_RECEIVED Received notification of type %1 for module %1: %2
 This informational message logs any YANG notification that has been signaled
 by the server, sent to kea-netconf which then was forwarded to subscribed
@@ -82,78 +89,73 @@ clients. To achieve this, kea-netconf subscribes itself as a client to all
 notifications for the configured module.
 
 % NETCONF_RUN_EXIT application is exiting the event loop
-This is a debug message issued when the Netconf application exits its
+This is a debug message issued when kea-netconf exits its
 event loop. This is a normal step during kea-netconf shutdown.
 
 % NETCONF_SET_CONFIG set configuration to %1 server: %2
-This debug message indicates that Netconf set the configuration to a
+This debug message indicates that kea-netconf set the configuration to a
 Kea server. The server name and the applied configuration are printed.
 
 % NETCONF_SET_CONFIG_FAILED setting configuration to %1 server failed: %2
-The error message indicates that Netconf got an error setting the
+The error message indicates that kea-netconf got an error setting the
 configuration to a Kea server. Make sure that the server is up and
 running, has appropriate control socket defined and that the controls
 socket configuration on the server matches that of kea-netconf. The
 name of the server and the error are printed.
 
 % NETCONF_SET_CONFIG_STARTED setting configuration to %1 server
-This informational message indicates that Netconf is trying to set the
+This informational message indicates that kea-netconf is trying to set the
 configuration to a Kea server.
 
-% NETCONF_STARTED Netconf (version %1) started
-This informational message indicates that Netconf has processed
+% NETCONF_STARTED kea-netconf (version %1) started
+This informational message indicates that kea-netconf has processed
 all configuration information and is ready to begin processing.
 The version is also printed.
 
 % NETCONF_SUBSCRIBE_CONFIG subscribing configuration changes for %1 server with %2 module
-This information message indicates that Netconf is trying to subscribe
+This information message indicates that kea-netconf is trying to subscribe
 configuration changes for a Kea server. The names of the server and
 the module are printed.
 
 % NETCONF_SUBSCRIBE_CONFIG_FAILED subscribe configuration changes for %1 server with %2 module failed: %3
-The error message indicates that Netconf got an error subscribing
+The error message indicates that kea-netconf got an error subscribing
 configuration changes for a Kea server. The names of the server and
 the module, and the error are printed.
 
 % NETCONF_SUBSCRIBE_NOTIFICATIONS subscribing to notifications for %1 server with %2 module
-This information message indicates that Netconf is trying to subscribe to
+This information message indicates that kea-netconf is trying to subscribe to
 notifications for a Kea server. The server name and module name are printed.
 
-% NETCONF_SUBSCRIBE_NOTIFICATIONS_FAILED subscribing to notifications for %1 server with %2 module failed: %3
-The error message indicates that Netconf got an error subscribing to
-notifications for a Kea server. The server name, module name and the error are
-printed.
-
 % NETCONF_UPDATE_CONFIG updating configuration with %1 server: %2
-This debug message indicates that Netconf update the configuration
+This debug message indicates that kea-netconf update the configuration
 of a Kea server. The server name and the updated configuration are
 printed.
 
 % NETCONF_UPDATE_CONFIG_COMPLETED completed updating configuration for %1 server
-This informational message indicates that Netconf updated with success the
+This informational message indicates that kea-netconf updated with success the
 configuration of a Kea server.
 
 % NETCONF_UPDATE_CONFIG_FAILED updating configuration with %1 server: %2
-The error message indicates that Netconf got an error updating the
+The error message indicates that kea-netconf got an error updating the
 configuration of a Kea server. This includes a configuration rejected
 by a Kea server when it tried to apply it. The name of the server and
 the error are printed.
 
 % NETCONF_UPDATE_CONFIG_STARTED started updating configuration for %1 server
-This informational message indicates that Netconf is trying to update the
+This informational message indicates that kea-netconf is trying to update the
 configuration of a Kea server.
 
 % NETCONF_VALIDATE_CONFIG validating configuration with %1 server: %2
-This debug message indicates that Netconf is validating the configuration
+This debug message indicates that kea-netconf is validating the configuration
 with a Kea server. The server name and the validated configuration are
 printed.
 
 % NETCONF_VALIDATE_CONFIG_COMPLETED completed validating configuration for %1 server
-This informational message indicates that Netconf validated with success the
+This informational message indicates that kea-netconf validated with success the
 configuration with a Kea server.
 
 % NETCONF_VALIDATE_CONFIG_FAILED validating configuration with %1 server got an error: %2
-The error message indicates that Netconf got an error validating the
+The error message indicates that kea-netconf got an error validating the
 configuration with a Kea server. This message is produced when
 exception is thrown during an attempt to validate received
 configuration. Additional explanation may be provided as a
@@ -161,7 +163,7 @@ parameter. You may also take a look at earlier log messages.  The name
 of the server and the error are printed.
 
 % NETCONF_VALIDATE_CONFIG_REJECTED validating configuration with %1 server was rejected: %2
-The warning message indicates that Netconf got an error validating the
+The warning message indicates that kea-netconf got an error validating the
 configuration with a Kea server. This message is printed when the
 configuration was rejected during normal processing. Additional
 explanation may be provided as a parameter. You may also take a look
@@ -169,5 +171,5 @@ at earlier log messages.  The name of the server and the error are
 printed.
 
 % NETCONF_VALIDATE_CONFIG_STARTED started validating configuration for %1 server
-This informational message indicates that Netconf is trying to validate the
+This informational message indicates that kea-netconf is trying to validate the
 configuration with a Kea server.
index 5bfb236d726dc68a554e40affec7cc827a9a0e99..be0a0a848e26e5994c7179c51550f171bb8594c6 100644 (file)
@@ -918,7 +918,7 @@ public:
     ///
     /// @param loc Location of the trailing comma.
     void addLog(const string& loc) {
-        string log = "NETCONF_CONFIG_SYNTAX_WARNING Netconf ";
+        string log = "NETCONF_CONFIG_SYNTAX_WARNING NETCONF ";
         log += "configuration syntax warning: " + loc;
         log += ": Extraneous comma. ";
         log += "A piece of configuration may have been omitted.";