Browse Source

[2559] Remove spurious commas in DHCP .spec files

Also correct error messages in the configuration parser: the
same error is logged on any parser error, both creation and
running.  The text was made more general.
Stephen Morris 12 years ago
parent
commit
6c6f405188

+ 2 - 3
src/bin/dhcp4/config_parser.cc

@@ -1706,7 +1706,7 @@ configureDhcp4Server(Dhcpv4Srv&, ConstElementPtr config_set) {
         }
         }
 
 
     } catch (const isc::Exception& ex) {
     } catch (const isc::Exception& ex) {
-        LOG_ERROR(dhcp4_logger, DHCP4_PARSER_CREATE_FAIL)
+        LOG_ERROR(dhcp4_logger, DHCP4_PARSER_FAIL)
                   .arg(config_pair.first).arg(ex.what());
                   .arg(config_pair.first).arg(ex.what());
         answer = isc::config::createAnswer(1,
         answer = isc::config::createAnswer(1,
                      string("Configuration parsing failed: ") + ex.what());
                      string("Configuration parsing failed: ") + ex.what());
@@ -1716,8 +1716,7 @@ configureDhcp4Server(Dhcpv4Srv&, ConstElementPtr config_set) {
 
 
     } catch (...) {
     } catch (...) {
         // for things like bad_cast in boost::lexical_cast
         // for things like bad_cast in boost::lexical_cast
-        LOG_ERROR(dhcp4_logger, DHCP4_PARSER_CREATE_EXCEPTION)
-                  .arg(config_pair.first);
+        LOG_ERROR(dhcp4_logger, DHCP4_PARSER_EXCEPTION).arg(config_pair.first);
         answer = isc::config::createAnswer(1,
         answer = isc::config::createAnswer(1,
                      string("Configuration parsing failed"));
                      string("Configuration parsing failed"));
 
 

+ 3 - 3
src/bin/dhcp4/dhcp4.spec

@@ -55,13 +55,13 @@
           { "item_name": "code",
           { "item_name": "code",
             "item_type": "integer",
             "item_type": "integer",
             "item_optional": false,
             "item_optional": false,
-            "item_default": 0,
+            "item_default": 0
           },
           },
 
 
           { "item_name": "type",
           { "item_name": "type",
             "item_type": "string",
             "item_type": "string",
             "item_optional": false,
             "item_optional": false,
-            "item_default": "",
+            "item_default": ""
           },
           },
 
 
           { "item_name": "array",
           { "item_name": "array",
@@ -73,7 +73,7 @@
           { "item_name": "record_types",
           { "item_name": "record_types",
             "item_type": "string",
             "item_type": "string",
             "item_optional": false,
             "item_optional": false,
-            "item_default": "",
+            "item_default": ""
           },
           },
 
 
           { "item_name": "space",
           { "item_name": "space",

+ 9 - 7
src/bin/dhcp4/dhcp4_messages.mes

@@ -132,16 +132,18 @@ A debug message output during a configuration update of the IPv4 DHCP
 server, notifying that the parser for the specified configuration element
 server, notifying that the parser for the specified configuration element
 has been successfully created.
 has been successfully created.
 
 
-% DHCP4_PARSER_CREATE_FAIL failed to create parser for configuration element %1: %2
+% DHCP4_PARSER_FAIL failed to create or run parser for configuration element %1: %2
 On receipt of message containing details to a change of its configuration,
 On receipt of message containing details to a change of its configuration,
-the IPv4 DHCP server failed to create a parser to decode the contents of the
-named configuration element.  The reason for the failure is given in the
-message.
+the IPv4 DHCP server failed to create a parser to decode the contents
+of the named configuration element, or the creation succeeded but the
+parsing actions and committal of changes failed.  The reason for the
+failure is given in the message.
 
 
-% DHCP4_PARSER_CREATE_EXCEPTION failed to create parser for configuration element %1
+% DHCP4_PARSER_EXCEPTION failed to create or run parser for configuration element %1
 On receipt of message containing details to a change of its configuration,
 On receipt of message containing details to a change of its configuration,
-the IPv4 DHCP server failed to create a parser to decode the contents
-of the named configuration element.  The message has been output in
+the IPv4 DHCP server failed to create a parser to decode the contents of
+the named configuration element, or the creation succeeded but the parsing
+actions and committal of changes failed.  The message has been output in
 response to a non-BIND 10 exception being raised.  Additional messages
 response to a non-BIND 10 exception being raised.  Additional messages
 may give further information.
 may give further information.
 
 

+ 2 - 3
src/bin/dhcp6/config_parser.cc

@@ -1763,7 +1763,7 @@ configureDhcp6Server(Dhcpv6Srv&, ConstElementPtr config_set) {
         }
         }
 
 
     } catch (const isc::Exception& ex) {
     } catch (const isc::Exception& ex) {
-        LOG_ERROR(dhcp6_logger, DHCP6_PARSER_CREATE_FAIL)
+        LOG_ERROR(dhcp6_logger, DHCP6_PARSER_FAIL)
                   .arg(config_pair.first).arg(ex.what());
                   .arg(config_pair.first).arg(ex.what());
         answer = isc::config::createAnswer(1,
         answer = isc::config::createAnswer(1,
                      string("Configuration parsing failed: ") + ex.what());
                      string("Configuration parsing failed: ") + ex.what());
@@ -1772,8 +1772,7 @@ configureDhcp6Server(Dhcpv6Srv&, ConstElementPtr config_set) {
 
 
     } catch (...) {
     } catch (...) {
         // for things like bad_cast in boost::lexical_cast
         // for things like bad_cast in boost::lexical_cast
-        LOG_ERROR(dhcp6_logger, DHCP6_PARSER_CREATE_EXCEPTION)
-                  .arg(config_pair.first);
+        LOG_ERROR(dhcp6_logger, DHCP6_PARSER_EXCEPTION).arg(config_pair.first);
         answer = isc::config::createAnswer(1,
         answer = isc::config::createAnswer(1,
                      string("Configuration parsing failed"));
                      string("Configuration parsing failed"));
         // An error occured, so make sure that we restore original data.
         // An error occured, so make sure that we restore original data.

+ 3 - 3
src/bin/dhcp6/dhcp6.spec

@@ -61,13 +61,13 @@
           { "item_name": "code",
           { "item_name": "code",
             "item_type": "integer",
             "item_type": "integer",
             "item_optional": false,
             "item_optional": false,
-            "item_default": 0,
+            "item_default": 0
           },
           },
 
 
           { "item_name": "type",
           { "item_name": "type",
             "item_type": "string",
             "item_type": "string",
             "item_optional": false,
             "item_optional": false,
-            "item_default": "",
+            "item_default": ""
           },
           },
 
 
           { "item_name": "array",
           { "item_name": "array",
@@ -79,7 +79,7 @@
           { "item_name": "record_types",
           { "item_name": "record_types",
             "item_type": "string",
             "item_type": "string",
             "item_optional": false,
             "item_optional": false,
-            "item_default": "",
+            "item_default": ""
           },
           },
 
 
           { "item_name": "space",
           { "item_name": "space",

+ 9 - 7
src/bin/dhcp6/dhcp6_messages.mes

@@ -189,16 +189,18 @@ A debug message output during a configuration update of the IPv6 DHCP
 server, notifying that the parser for the specified configuration element
 server, notifying that the parser for the specified configuration element
 has been successfully created.
 has been successfully created.
 
 
-% DHCP6_PARSER_CREATE_FAIL failed to create parser for configuration element %1: %2
+% DHCP6_PARSER_FAIL failed to create or run parser for configuration element %1: %2
 On receipt of message containing details to a change of its configuration,
 On receipt of message containing details to a change of its configuration,
-the IPv6 DHCP server failed to create a parser to decode the contents of the
-named configuration element.  The reason for the failure is given in the
-message.
+the IPv6 DHCP server failed to create a parser to decode the contents
+of the named configuration element, or the creation succeeded but the
+parsing actions and committal of changes failed.  The reason for the
+failure is given in the message.
 
 
-% DHCP6_PARSER_CREATE_EXCEPTION failed to create parser for configuration element %1
+% DHCP6_PARSER_EXCEPTION failed to create or run parser for configuration element %1
 On receipt of message containing details to a change of its configuration,
 On receipt of message containing details to a change of its configuration,
-the IPv6 DHCP server failed to create a parser to decode the contents
-of the named configuration element.  The message has been output in
+the IPv6 DHCP server failed to create a parser to decode the contents of
+the named configuration element, or the creation succeeded but the parsing
+actions and committal of changes failed.  The message has been output in
 response to a non-BIND 10 exception being raised.  Additional messages
 response to a non-BIND 10 exception being raised.  Additional messages
 may give further information.
 may give further information.