]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[153-netconf-agent] Addressed final comments 153-netconf-agent
authorFrancis Dupont <fdupont@isc.org>
Tue, 30 Oct 2018 11:48:45 +0000 (12:48 +0100)
committerFrancis Dupont <fdupont@isc.org>
Tue, 30 Oct 2018 11:50:38 +0000 (07:50 -0400)
src/bin/netconf/netconf.cc
src/bin/netconf/netconf_messages.mes

index b1e5d0e5da6083a71b3652e77f6b71511bde6940..f8509d3774dc182f547507cca960517bff3ae57f 100644 (file)
@@ -188,7 +188,7 @@ NetconfAgent::keaConfig(const CfgServersMapPair& service_pair) {
     ConstElementPtr answer;
     int rcode;
     ConstElementPtr config;
-    LOG_DEBUG(netconf_logger, NETCONF_DBG_TRACE, NETCONF_GET_CONFIG)
+    LOG_INFO(netconf_logger, NETCONF_GET_CONFIG_STARTED)
         .arg(service_pair.first);
     try {
         answer = comm->configGet(service_pair.first);
@@ -218,11 +218,8 @@ NetconfAgent::keaConfig(const CfgServersMapPair& service_pair) {
             .arg("config-get command returned an empty configuration");
         return;
     }
-    LOG_INFO(netconf_logger, NETCONF_BOOT_UPDATE_COMPLETE)
-        .arg(service_pair.first);
-
     LOG_DEBUG(netconf_logger, NETCONF_DBG_TRACE_DETAIL_DATA,
-              NETCONF_GET_CONFIG_CONFIG)
+              NETCONF_GET_CONFIG)
         .arg(service_pair.first)
         .arg(prettyPrint(config));
 }
@@ -261,7 +258,7 @@ NetconfAgent::yangConfig(const CfgServersMapPair& service_pair) {
         return;
     }
 
-    LOG_DEBUG(netconf_logger, NETCONF_DBG_TRACE, NETCONF_SET_CONFIG)
+    LOG_INFO(netconf_logger, NETCONF_SET_CONFIG_STARTED)
         .arg(service_pair.first);
     ConstElementPtr config;
     try {
@@ -279,7 +276,7 @@ NetconfAgent::yangConfig(const CfgServersMapPair& service_pair) {
             return;
         } else {
             LOG_DEBUG(netconf_logger, NETCONF_DBG_TRACE_DETAIL_DATA,
-                      NETCONF_SET_CONFIG_CONFIG)
+                      NETCONF_SET_CONFIG)
                 .arg(service_pair.first)
                 .arg(prettyPrint(config));
         }
@@ -328,7 +325,10 @@ NetconfAgent::yangConfig(const CfgServersMapPair& service_pair) {
         LOG_ERROR(netconf_logger, NETCONF_SET_CONFIG_FAILED)
             .arg(service_pair.first)
             .arg(msg.str());
+        return;
     }
+    LOG_INFO(netconf_logger, NETCONF_BOOT_UPDATE_COMPLETED)
+        .arg(service_pair.first);
 }
 
 void
@@ -382,8 +382,7 @@ NetconfAgent::validate(S_Session sess, const CfgServersMapPair& service_pair) {
     if (!ctrl_sock) {
         return (SR_ERR_OK);
     }
-    LOG_DEBUG(netconf_logger, NETCONF_DBG_TRACE,
-              NETCONF_VALIDATE_CONFIG_STARTED)
+    LOG_INFO(netconf_logger, NETCONF_VALIDATE_CONFIG_STARTED)
         .arg(service_pair.first);
     ConstElementPtr config;
     try {
@@ -448,6 +447,8 @@ NetconfAgent::validate(S_Session sess, const CfgServersMapPair& service_pair) {
             .arg(msg.str());
         return (SR_ERR_VALIDATION_FAILED);
     }
+    LOG_INFO(netconf_logger, NETCONF_VALIDATE_CONFIG_COMPLETED)
+        .arg(service_pair.first);
     return (SR_ERR_OK);
 }
 
@@ -466,7 +467,7 @@ NetconfAgent::update(S_Session sess, const CfgServersMapPair& service_pair) {
 
     // All looks good, let's get started. Print an info that we're about
     // to update the configuration.
-    LOG_DEBUG(netconf_logger, NETCONF_DBG_TRACE, NETCONF_UPDATE_CONFIG_STARTED)
+    LOG_INFO(netconf_logger, NETCONF_UPDATE_CONFIG_STARTED)
         .arg(service_pair.first);
 
     // Retrieve the configuration from SYSREPO first.
@@ -540,6 +541,8 @@ NetconfAgent::update(S_Session sess, const CfgServersMapPair& service_pair) {
             .arg(msg.str());
         return (SR_ERR_VALIDATION_FAILED);
     }
+    LOG_INFO(netconf_logger, NETCONF_UPDATE_CONFIG_COMPLETED)
+        .arg(service_pair.first);
     return (SR_ERR_OK);
 }
 
index 0cb4c0ea80a68b8685b4b1b45826f2f7d899a546..c21ab1033cff3bc9aa720633167f5aec0fd7e0b3 100644 (file)
@@ -6,7 +6,7 @@
 
 $NAMESPACE isc::netconf
 
-% NETCONF_BOOT_UPDATE_COMPLETE Boot-update configuration completed for server %1
+% 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.
 
@@ -33,11 +33,7 @@ in earlier log entries, possibly on lower levels.
 This is a fatal error message issued when the Netconf application
 got an unrecoverable error from within the event loop.
 
-% NETCONF_GET_CONFIG getting configuration from %1 server
-This debug message indicates that Netconf is trying to get the
-configuration from a Kea server.
-
-% NETCONF_GET_CONFIG_CONFIG got configuration from %1 server: %2
+% NETCONF_GET_CONFIG got configuration from %1 server: %2
 This debug message indicates that Netconf got the configuration from a
 Kea server. The server name and the retrieved configuration are printed.
 
@@ -48,6 +44,10 @@ 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
+configuration from a Kea server.
+
 % 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.
@@ -56,11 +56,7 @@ encountered an unexpected condition. Details of it will be logged.
 This is a debug message issued when the Netconf application exits its
 event loop. This is a normal step during kea-netconf shutdown.
 
-% NETCONF_SET_CONFIG setting configuration to %1 server
-This debug message indicates that Netconf is trying to set the
-configuration to a Kea server.
-
-% NETCONF_SET_CONFIG_CONFIG set configuration to %1 server: %2
+% NETCONF_SET_CONFIG set configuration to %1 server: %2
 This debug message indicates that Netconf set the configuration to a
 Kea server. The server name and the applied configuration are printed.
 
@@ -71,6 +67,10 @@ 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
+configuration to a Kea server.
+
 % NETCONF_STARTED Netconf (version %1) started
 This informational message indicates that Netconf has processed
 all configuration information and is ready to begin processing.
@@ -86,15 +86,15 @@ The error message indicates that 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_VALIDATE_CONFIG_STARTED started validating configuration for %1 server
-This debug message indicates that Netconf is trying to validate the
-configuration with a Kea server.
-
 % NETCONF_VALIDATE_CONFIG validating configuration with %1 server: %2
 This debug message indicates that 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
+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
 configuration with a Kea server. This message is produced when
@@ -111,17 +111,25 @@ explanation may be provided as a parameter. You may also take a look
 at earlier log messages.  The name of the server and the error are
 printed.
 
-% NETCONF_UPDATE_CONFIG_STARTED started updating configuration for %1 server
-This debug message indicates that Netconf is trying to update the
-configuration of a Kea server.
+% NETCONF_VALIDATE_CONFIG_STARTED started validating configuration for %1 server
+This informational message indicates that Netconf is trying to validate the
+configuration with a Kea server.
 
 % NETCONF_UPDATE_CONFIG updating configuration with %1 server: %2
 This debug message indicates that 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
+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
 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
+configuration of a Kea server.