Browse Source

[5031] Hooks parser now detects if hooksmgr failed to load libraries.

Tomek Mrugalski 8 years ago
parent
commit
8b8dde99d3
2 changed files with 10 additions and 5 deletions
  1. 3 1
      src/lib/dhcpsrv/parsers/dhcp_parsers.cc
  2. 7 4
      src/lib/dhcpsrv/parsers/dhcp_parsers.h

+ 3 - 1
src/lib/dhcpsrv/parsers/dhcp_parsers.cc

@@ -357,7 +357,9 @@ HooksLibrariesParser::loadLibraries() {
     /// the list of libraries has changed.
     /// @todo: Delete any stored CalloutHandles before reloading the
     /// libraries
-    HooksManager::loadLibraries(libraries_);
+    if (!HooksManager::loadLibraries(libraries_)) {
+        isc_throw(DhcpConfigError, "One or more hook libraries failed to load");
+    }
 }
 
 // Method for testing

+ 7 - 4
src/lib/dhcpsrv/parsers/dhcp_parsers.h

@@ -496,10 +496,13 @@ public:
 
     /// @brief Commits hooks libraries data
     ///
-    /// This method calls necessary methods in HooksManager that will load the
-    /// actual libraries. Providing that the specified libraries are valid and are different
-    /// to those already loaded, this method loads the new set of libraries
-    /// (and unloads the existing set).
+    /// This method calls necessary methods in HooksManager that will unload
+    /// any libraries that may be currently loaded and will load the actual
+    /// libraries. Providing that the specified libraries are valid and are
+    /// different to those already loaded, this method loads the new set of
+    /// libraries (and unloads the existing set).
+    ///
+    /// @throw DhcpConfigError if the call to HooksManager fails.
     void loadLibraries();
 
     /// @brief Returns list of parsed libraries