From: Tomek Mrugalski Date: Thu, 12 Jan 2017 11:51:48 +0000 (+0100) Subject: [5031] Hooks parser now detects if hooksmgr failed to load libraries. X-Git-Tag: fdppjson_base~2^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8b8dde99d3326ec2c64f9be7bf4260b3599df16e;p=thirdparty%2Fkea.git [5031] Hooks parser now detects if hooksmgr failed to load libraries. --- diff --git a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc b/src/lib/dhcpsrv/parsers/dhcp_parsers.cc index e3cc9d9c58..f0d0b74d5f 100644 --- a/src/lib/dhcpsrv/parsers/dhcp_parsers.cc +++ b/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 diff --git a/src/lib/dhcpsrv/parsers/dhcp_parsers.h b/src/lib/dhcpsrv/parsers/dhcp_parsers.h index 36e53eae37..c047f95977 100644 --- a/src/lib/dhcpsrv/parsers/dhcp_parsers.h +++ b/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