From: Razvan Becheriu Date: Wed, 17 Feb 2021 14:43:58 +0000 (+0200) Subject: [#899] addressed comments X-Git-Tag: Kea-1.9.5~51 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b08ce55081eddcfc7cab8a689d414373653ac4e4;p=thirdparty%2Fkea.git [#899] addressed comments --- diff --git a/doc/sphinx/arm/hooks-run-script.rst b/doc/sphinx/arm/hooks-run-script.rst index 5aa1cf1502..34b6feff80 100644 --- a/doc/sphinx/arm/hooks-run-script.rst +++ b/doc/sphinx/arm/hooks-run-script.rst @@ -10,35 +10,20 @@ The library is available since Kea 1.9.5 and can be loaded in a similar way as other hook libraries by the ``kea-dhcp4`` and ``kea-dhcp6`` processes. -:: - - "Dhcp4": { - "hooks-libraries": [ - { "library": "/usr/local/lib/libdhcp_run_script.so", - "parameters": { - "name": "/path_to/script_name.sh", - "sync": false - } - }, - ... - ] - } - -:: +.. code-block:: json - "Dhcp6": { + { "hooks-libraries": [ - { "library": "/usr/local/lib/libdhcp_run_script.so", + { + "library": "/usr/local/lib/libdhcp_run_script.so", "parameters": { "name": "/path_to/script_name.sh", "sync": false } - }, - ... + } ] } - The parameters contain the 'name' which indicates the path to the external script to be called on each hookpoint, and also the 'sync' option to be able to wait synchronously for the script to finish execution. @@ -46,13 +31,11 @@ If the 'sync' parameter is false, then the script will be launched and Kea will not wait for the execution to finish, causing all the OUT parameters of the script (including next step) to be ignored. - .. note:: Currently the functionality underneath 'sync' parameter is not implemented and enabling synchronous calls to external script is not supported. - .. _hooks-run-script-hook-points: This library has several hook points functions implemented which will be @@ -620,5 +603,3 @@ lease6_decline LEASE6_PREFERRED_LIFETIME LEASE6_PREFIX_LEN LEASE6_TYPE - - diff --git a/doc/sphinx/arm/hooks.rst b/doc/sphinx/arm/hooks.rst index 8cec5537cf..09c7593474 100644 --- a/doc/sphinx/arm/hooks.rst +++ b/doc/sphinx/arm/hooks.rst @@ -2945,14 +2945,14 @@ both the command and the response. .. include:: hooks-bootp.rst -.. include:: hooks-cb-cmds.rst .. include:: hooks-class-cmds.rst +.. include:: hooks-cb-cmds.rst .. include:: hooks-ha.rst +.. include:: hooks-stat-cmds.rst +.. include:: hooks-radius.rst .. include:: hooks-host-cache.rst .. include:: hooks-lease-query.rst -.. include:: hooks-radius.rst .. include:: hooks-run-script.rst -.. include:: hooks-stat-cmds.rst .. _user-context-hooks: diff --git a/src/hooks/dhcp/run_script/run_script.cc b/src/hooks/dhcp/run_script/run_script.cc index 91b43442ed..3f7fe656ee 100644 --- a/src/hooks/dhcp/run_script/run_script.cc +++ b/src/hooks/dhcp/run_script/run_script.cc @@ -23,9 +23,6 @@ IOServicePtr RunScriptImpl::io_service_; RunScriptImpl::RunScriptImpl() : name_(), sync_(false) { } -RunScriptImpl::~RunScriptImpl() { -} - void RunScriptImpl::configure(LibraryHandle& handle) { ConstElementPtr name = handle.getParameter("name"); diff --git a/src/hooks/dhcp/run_script/run_script.h b/src/hooks/dhcp/run_script/run_script.h index 9902105c60..d12612d037 100644 --- a/src/hooks/dhcp/run_script/run_script.h +++ b/src/hooks/dhcp/run_script/run_script.h @@ -28,7 +28,7 @@ public: RunScriptImpl(); /// @brief Destructor. - ~RunScriptImpl(); + ~RunScriptImpl() = default; /// @brief Sets IO service to be used by the @ref ProcessSpawn instance. ///