Browse Source

[master] Merge branch 'trac3459'

Stephen Morris 10 years ago
parent
commit
35860175e8

+ 1 - 1
src/bin/dhcp4/kea_controller.cc

@@ -100,7 +100,7 @@ void configure(const std::string& file_name) {
     if (rcode != 0) {
     if (rcode != 0) {
         string reason = "";
         string reason = "";
         if (comment) {
         if (comment) {
-            reason = string(" (") + comment->stringValue() + string(")");
+            reason = comment->stringValue();
         }
         }
         LOG_ERROR(dhcp4_logger, DHCP4_CONFIG_LOAD_FAIL).arg(reason);
         LOG_ERROR(dhcp4_logger, DHCP4_CONFIG_LOAD_FAIL).arg(reason);
         isc_throw(isc::BadValue, "Failed to apply configuration: " << reason);
         isc_throw(isc::BadValue, "Failed to apply configuration: " << reason);

+ 6 - 0
src/bin/dhcp4/main.cc

@@ -97,6 +97,12 @@ main(int argc, char* argv[]) {
         usage();
         usage();
     }
     }
 
 
+    // Configuration file is required.
+    if (config_file.empty()) {
+        cerr << "Configuration file not specified." << endl;
+        usage();
+    }
+
     int ret = EXIT_SUCCESS;
     int ret = EXIT_SUCCESS;
 
 
     try {
     try {

+ 1 - 1
src/bin/dhcp6/kea_controller.cc

@@ -103,7 +103,7 @@ void configure(const std::string& file_name) {
     if (rcode != 0) {
     if (rcode != 0) {
         string reason = "";
         string reason = "";
         if (comment) {
         if (comment) {
-            reason = string(" (") + comment->stringValue() + string(")");
+            reason = comment->stringValue();
         }
         }
         LOG_ERROR(dhcp6_logger, DHCP6_CONFIG_LOAD_FAIL).arg(reason);
         LOG_ERROR(dhcp6_logger, DHCP6_CONFIG_LOAD_FAIL).arg(reason);
         isc_throw(isc::BadValue, "Failed to apply configuration:" << reason);
         isc_throw(isc::BadValue, "Failed to apply configuration:" << reason);

+ 6 - 0
src/bin/dhcp6/main.cc

@@ -97,6 +97,12 @@ main(int argc, char* argv[]) {
         usage();
         usage();
     }
     }
 
 
+    // Configuration file is required.
+    if (config_file.empty()) {
+        cerr << "Configuration file not specified." << endl;
+        usage();
+    }
+
 
 
     int ret = EXIT_SUCCESS;
     int ret = EXIT_SUCCESS;
     try {
     try {