From 3bf0079360ba66f7e0e5f67010606f0bbeadb84e Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Fri, 20 Dec 2024 21:27:50 +0200 Subject: [PATCH] [#2101] addressed review comments --- ChangeLog | 6 ++++++ doc/sphinx/arm/hooks.rst | 6 ++++-- src/lib/hooks/hooks_parser.h | 4 ++-- src/lib/process/cfgrpt/tests/config_report_unittests.cc | 3 ++- 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4aebea4b21..b1f4186330 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2315. [func] razvan + Kea can now load hook libraries specifying only the binary name. + It uses the default hook libraries installation path which is + provided in the config report as "Hooks directory". + (Gitlab #2101, #3579) + 2314. [func] tmark Added three new parameters which may be used to influence DNS TTL to kea-dhcp4 and kea-dhcp6: diff --git a/doc/sphinx/arm/hooks.rst b/doc/sphinx/arm/hooks.rst index 1bd1bc4623..728a38acc6 100644 --- a/doc/sphinx/arm/hooks.rst +++ b/doc/sphinx/arm/hooks.rst @@ -213,8 +213,10 @@ configuration would be: because the parameters specified for the library (or the files those parameters point to) may have changed. -Since Kea-2.7.5, the server is able to load hooks specified only by name, if -they reside in the default install location (the path is OS specific). +Since Kea-2.7.6, the server is able to load hook libraries specifying only the binary name, +if they reside in the default installation directory (the path is OS specific). +The default hook libraries installation path is provided in the config report as +"Hooks directory". :: diff --git a/src/lib/hooks/hooks_parser.h b/src/lib/hooks/hooks_parser.h index 0fea1fe26b..8815d8497d 100644 --- a/src/lib/hooks/hooks_parser.h +++ b/src/lib/hooks/hooks_parser.h @@ -58,8 +58,8 @@ class HooksLibrariesParser : public isc::data::SimpleParser { /// @param value pointer to the content to be parsed void parse(HooksConfig& libraries, isc::data::ConstElementPtr value); - /// @brief The default installation path for hooks, used to generate full - /// path if only the hook name is provided. + /// @brief The default installation path for hook libraries, used to generate + /// full path if only the hook library binary name is provided. static std::string default_hooks_path_; }; diff --git a/src/lib/process/cfgrpt/tests/config_report_unittests.cc b/src/lib/process/cfgrpt/tests/config_report_unittests.cc index a783f3d196..cc756ce6f0 100644 --- a/src/lib/process/cfgrpt/tests/config_report_unittests.cc +++ b/src/lib/process/cfgrpt/tests/config_report_unittests.cc @@ -27,5 +27,6 @@ TEST(ConfigReportTest, getConfigReport) { ASSERT_FALSE(cfgReport.empty()); EXPECT_NE(std::string::npos, cfgReport.find(VERSION)); EXPECT_NE(std::string::npos, cfgReport.find(EXTENDED_VERSION)); - EXPECT_NE(std::string::npos, cfgReport.find(HooksLibrariesParser::default_hooks_path_)); + EXPECT_NE(std::string::npos, cfgReport.find(std::string("Hooks directory: ") + + HooksLibrariesParser::default_hooks_path_)); }