]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[65-libyang-database] New fixes
authorFrancis Dupont <fdupont@isc.org>
Sat, 22 Sep 2018 14:45:53 +0000 (16:45 +0200)
committerFrancis Dupont <fdupont@isc.org>
Sat, 22 Sep 2018 14:45:53 +0000 (16:45 +0200)
src/lib/yang/translator_database.cc
src/lib/yang/translator_database.h

index dfbf23df9df81e48b5435303ae5b90adfc9d6189..1fdc8d7bc420748e7c87a5777ec8122917a12c37 100644 (file)
@@ -41,9 +41,7 @@ ElementPtr
 TranslatorDatabase::getDatabaseKea(const string& xpath) {
     ConstElementPtr type = getItem(xpath + "/database-type");
     if (!type) {
-        // Can't happen as database-type is the key.
-        isc_throw(Unexpected, "getDatabaseKea requires database-type: "
-                  << xpath);
+        return (ElementPtr());
     }
     ElementPtr result = Element::createMap();
     result->set("type", type);
index 6c91c9484322b9e30493d1a09bbd002b8b051cc2..7d30a62760d56d501da1e1eb05391385f3aa38d3 100644 (file)
@@ -101,7 +101,7 @@ protected:
     /// @brief getDatabase JSON for kea-dhcp[46].
     ///
     /// @param xpath The xpath of the database.
-    /// @return JSON representation of the database.
+    /// @return JSON representation of the database or null if none.
     /// @throw SysrepoError when sysrepo raises an error.
     isc::data::ElementPtr getDatabaseKea(const std::string& xpath);