From 8b8dde99d3326ec2c64f9be7bf4260b3599df16e Mon Sep 17 00:00:00 2001 From: Tomek Mrugalski Date: Thu, 12 Jan 2017 12:51:48 +0100 Subject: [PATCH] [5031] Hooks parser now detects if hooksmgr failed to load libraries. --- src/lib/dhcpsrv/parsers/dhcp_parsers.cc | 4 +++- src/lib/dhcpsrv/parsers/dhcp_parsers.h | 11 +++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) 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 -- 2.47.2