Browse Source

[2832] roll back all of 946b1df except typo fix

Paul Selkirk 12 years ago
parent
commit
754c38ee58
2 changed files with 1 additions and 12 deletions
  1. 1 5
      src/lib/datasrc/cache_config.cc
  2. 0 7
      src/lib/datasrc/tests/cache_config_unittest.cc

+ 1 - 5
src/lib/datasrc/cache_config.cc

@@ -42,11 +42,7 @@ getSegmentTypeFromConf(const Element& conf) {
     if (!conf.contains("cache-type")) {
         return ("local");
     }
-    std::string cache_type = conf.get("cache-type")->stringValue();
-    if ((cache_type != "local") && (cache_type != "mapped")) {
-        isc_throw(CacheConfigError, "invalid cache-type");
-    }
-    return (cache_type);
+    return (conf.get("cache-type")->stringValue());
 }
 }
 

+ 0 - 7
src/lib/datasrc/tests/cache_config_unittest.cc

@@ -238,13 +238,6 @@ TEST_F(CacheConfigTest, getSegmentType) {
                                                 " \"params\": {}}"));
     EXPECT_THROW(CacheConfig("MasterFiles", 0, *badconfig, true),
                  isc::data::TypeError);
-
-    // Bad value: should be rejected at construction time
-    ConstElementPtr badconfig2(Element::fromJSON("{\"cache-enable\": true,"
-                                                " \"cache-type\": \"bogus\","
-                                                " \"params\": {}}"));
-    EXPECT_THROW(CacheConfig("MasterFiles", 0, *badconfig2, true),
-                 isc::datasrc::internal::CacheConfigError);
 }
 
 }