From: Francis Dupont Date: Thu, 13 Jun 2019 00:01:42 +0000 (+0200) Subject: [616-error-msgs-contain-references-to-config-file-while-config-backend-is-used] Impro... X-Git-Tag: Kea-1.6.0-beta2~183 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ca63c5a217fc8064336fd596bd758807a3d86a14;p=thirdparty%2Fkea.git [616-error-msgs-contain-references-to-config-file-while-config-backend-is-used] Improved messages (but still not found the bug) --- diff --git a/src/bin/dhcp4/ctrl_dhcp4_srv.cc b/src/bin/dhcp4/ctrl_dhcp4_srv.cc index e251b48b8b..3964a1a3fb 100644 --- a/src/bin/dhcp4/ctrl_dhcp4_srv.cc +++ b/src/bin/dhcp4/ctrl_dhcp4_srv.cc @@ -232,7 +232,7 @@ ControlledDhcpv4Srv::commandConfigReloadHandler(const string&, LOG_ERROR(dhcp4_logger, DHCP4_DYNAMIC_RECONFIGURATION_FAIL) .arg(file); return (createAnswer(CONTROL_RESULT_ERROR, - "Config reload failed:" + string(ex.what()))); + "Config reload failed: " + string(ex.what()))); } } diff --git a/src/bin/dhcp4/dhcp4_messages.cc b/src/bin/dhcp4/dhcp4_messages.cc index cad1111a56..0c8bf01580 100644 --- a/src/bin/dhcp4/dhcp4_messages.cc +++ b/src/bin/dhcp4/dhcp4_messages.cc @@ -188,7 +188,7 @@ const char* values[] = { "DHCP4_DHCP4O6_RECEIVE_FAIL", "failed to receive DHCPv4o6: %1", "DHCP4_DHCP4O6_RECEIVING", "receiving DHCPv4o6 packet from DHCPv6 server", "DHCP4_DHCP4O6_RESPONSE_DATA", "%1: responding with packet %2 (type %3), packet details: %4", - "DHCP4_DYNAMIC_RECONFIGURATION", "initiate server reconfiguration using file: %1, after receiving SIGHUP signal", + "DHCP4_DYNAMIC_RECONFIGURATION", "initiate server reconfiguration using file: %1, after receiving SIGHUP signal or config-reload command", "DHCP4_DYNAMIC_RECONFIGURATION_FAIL", "dynamic server reconfiguration failed with file: %1", "DHCP4_EMPTY_HOSTNAME", "%1: received empty hostname from the client, skipping processing of this option", "DHCP4_FLEX_ID", "flexible identifier generated for incoming packet: %1", diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes index f7f1251440..40a02f109b 100644 --- a/src/bin/dhcp4/dhcp4_messages.mes +++ b/src/bin/dhcp4/dhcp4_messages.mes @@ -270,9 +270,9 @@ information. The second and third argument contains the packet name and type respectively. The fourth argument contains detailed packet information. -% DHCP4_DYNAMIC_RECONFIGURATION initiate server reconfiguration using file: %1, after receiving SIGHUP signal +% DHCP4_DYNAMIC_RECONFIGURATION initiate server reconfiguration using file: %1, after receiving SIGHUP signal or config-reload command This is the info message logged when the DHCPv4 server starts reconfiguration -as a result of receiving SIGHUP signal. +as a result of receiving SIGHUP signal or config-reload command. % DHCP4_DYNAMIC_RECONFIGURATION_FAIL dynamic server reconfiguration failed with file: %1 This is an error message logged when the dynamic reconfiguration of the diff --git a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc index b76e8616e1..27ce7bf1db 100644 --- a/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc +++ b/src/bin/dhcp4/tests/ctrl_dhcp4_srv_unittest.cc @@ -1076,7 +1076,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configReloadMissingFile) { sendUnixCommand("{ \"command\": \"config-reload\" }", response); // Verify the reload was rejected. - EXPECT_EQ("{ \"result\": 1, \"text\": \"Config reload failed:" + EXPECT_EQ("{ \"result\": 1, \"text\": \"Config reload failed: " "configuration error using file 'test6.json': Unable to open file " "test6.json\" }", response); @@ -1102,7 +1102,7 @@ TEST_F(CtrlChannelDhcpv4SrvTest, configReloadBrokenFile) { sendUnixCommand("{ \"command\": \"config-reload\" }", response); // Verify the reload will fail. - EXPECT_EQ("{ \"result\": 1, \"text\": \"Config reload failed:" + EXPECT_EQ("{ \"result\": 1, \"text\": \"Config reload failed: " "configuration error using file 'test7.json': " "test7.json:1.1: Invalid character: g\" }", response); diff --git a/src/bin/dhcp6/ctrl_dhcp6_srv.cc b/src/bin/dhcp6/ctrl_dhcp6_srv.cc index ee95de32cd..8cb2737cce 100644 --- a/src/bin/dhcp6/ctrl_dhcp6_srv.cc +++ b/src/bin/dhcp6/ctrl_dhcp6_srv.cc @@ -234,7 +234,7 @@ ControlledDhcpv6Srv::commandConfigReloadHandler(const string&, LOG_ERROR(dhcp6_logger, DHCP6_DYNAMIC_RECONFIGURATION_FAIL) .arg(file); return (createAnswer(CONTROL_RESULT_ERROR, - "Config reload failed:" + string(ex.what()))); + "Config reload failed: " + string(ex.what()))); } } diff --git a/src/bin/dhcp6/dhcp6_messages.cc b/src/bin/dhcp6/dhcp6_messages.cc index ccca0726be..e98775602d 100644 --- a/src/bin/dhcp6/dhcp6_messages.cc +++ b/src/bin/dhcp6/dhcp6_messages.cc @@ -195,7 +195,7 @@ const char* values[] = { "DHCP6_DHCP4O6_RECEIVE_FAIL", "failed to receive DHCPv4o6: %1", "DHCP6_DHCP4O6_RECEIVING", "receiving DHCPv4o6 packet from DHCPv4 server", "DHCP6_DHCP4O6_SEND_FAIL", "failed to send DHCPv4o6 packet: %1", - "DHCP6_DYNAMIC_RECONFIGURATION", "initiate server reconfiguration using file: %1, after receiving SIGHUP signal", + "DHCP6_DYNAMIC_RECONFIGURATION", "initiate server reconfiguration using file: %1, after receiving SIGHUP signal or config-reload command", "DHCP6_DYNAMIC_RECONFIGURATION_FAIL", "dynamic server reconfiguration failed with file: %1", "DHCP6_FLEX_ID", "flexible identifier generated for incoming packet: %1", "DHCP6_HANDLE_SIGNAL_EXCEPTION", "An exception was thrown while handing signal: %1", diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes index ac797aaf1f..076cd86381 100644 --- a/src/bin/dhcp6/dhcp6_messages.mes +++ b/src/bin/dhcp6/dhcp6_messages.mes @@ -282,9 +282,9 @@ This error is output if the IPv6 DHCP server fails to send an assembled DHCPv4o6 message to a client. The reason for the error is included in the message. -% DHCP6_DYNAMIC_RECONFIGURATION initiate server reconfiguration using file: %1, after receiving SIGHUP signal +% DHCP6_DYNAMIC_RECONFIGURATION initiate server reconfiguration using file: %1, after receiving SIGHUP signal or config-reload command This is the info message logged when the DHCPv6 server starts reconfiguration -as a result of receiving SIGHUP signal. +as a result of receiving SIGHUP signal or config-reload command. % DHCP6_DYNAMIC_RECONFIGURATION_FAIL dynamic server reconfiguration failed with file: %1 This is an error message logged when the dynamic reconfiguration of the diff --git a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc index e8742cfd0e..3162406ea2 100644 --- a/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc +++ b/src/bin/dhcp6/tests/ctrl_dhcp6_srv_unittest.cc @@ -1100,7 +1100,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configReloadMissingFile) { sendUnixCommand("{ \"command\": \"config-reload\" }", response); // Verify the reload was rejected. - EXPECT_EQ("{ \"result\": 1, \"text\": \"Config reload failed:" + EXPECT_EQ("{ \"result\": 1, \"text\": \"Config reload failed: " "configuration error using file 'test6.json': Unable to open file " "test6.json\" }", response); @@ -1126,7 +1126,7 @@ TEST_F(CtrlChannelDhcpv6SrvTest, configReloadBrokenFile) { sendUnixCommand("{ \"command\": \"config-reload\" }", response); // Verify the reload will fail. - EXPECT_EQ("{ \"result\": 1, \"text\": \"Config reload failed:" + EXPECT_EQ("{ \"result\": 1, \"text\": \"Config reload failed: " "configuration error using file 'test7.json': " "test7.json:1.1: Invalid character: g\" }", response);