From 998fbcbc73ad9dc41f78954a7e3cac6fa98909d0 Mon Sep 17 00:00:00 2001 From: Razvan Becheriu Date: Tue, 9 Sep 2025 20:12:57 +0300 Subject: [PATCH] [#3961] fixed typos --- doc/sphinx/arm/hooks-cb-cmds.rst | 4 ++-- src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc | 3 ++- src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc | 4 ++-- src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc | 3 ++- src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc | 3 ++- src/lib/dhcpsrv/cfg_option.cc | 2 +- src/lib/dhcpsrv/dhcpsrv_messages.mes | 4 ++-- src/lib/dhcpsrv/tests/cfg_option_unittest.cc | 2 +- src/lib/dhcpsrv/testutils/alloc_engine_utils.cc | 2 +- .../testutils/generic_cb_dhcp4_unittest.cc | 17 ++++++++--------- .../testutils/generic_cb_dhcp4_unittest.h | 8 ++++---- .../testutils/generic_cb_dhcp6_unittest.cc | 16 ++++++++++++---- .../testutils/generic_cb_dhcp6_unittest.h | 8 ++++---- .../testutils/test_config_backend_dhcp4.cc | 2 +- .../testutils/test_config_backend_dhcp6.cc | 1 - src/lib/yang/adaptor_option.h | 2 +- src/share/api/remote-option-def4-del.json | 2 +- src/share/api/remote-option-def6-del.json | 2 +- 18 files changed, 47 insertions(+), 38 deletions(-) diff --git a/doc/sphinx/arm/hooks-cb-cmds.rst b/doc/sphinx/arm/hooks-cb-cmds.rst index 1bcd06da9b..39c8407d64 100644 --- a/doc/sphinx/arm/hooks-cb-cmds.rst +++ b/doc/sphinx/arm/hooks-cb-cmds.rst @@ -996,7 +996,7 @@ the keyword "all" must be used as the server tag. The ``server-tags`` list must contain exactly one tag and cannot include the ``null`` value. As of Kea 3.1.2, before deleting an option definition, the server will first -check if there are any options specified that depend upon that defintion. If +check if there are any options specified that depend upon that definition. If so the delete command will be rejected with an error message explaining why. This default behavior may be overridden by setting the optional ``force`` parameter to true as shown below: @@ -1023,7 +1023,7 @@ parameter to true as shown below: .. note:: The ``force`` parameter should only be used after careful consideration. - Removing an option definition while a dependent option specfication exists + Removing an option definition while a dependent option specification exists will cause that option to be excluded from the running configuration. This parameter is provided to handle use cases where a definition may need to be corrected while leaving the option in place. diff --git a/src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc b/src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc index 7e1d3461bf..0d39c88803 100644 --- a/src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc +++ b/src/hooks/dhcp/mysql/mysql_cb_dhcp4.cc @@ -2197,6 +2197,7 @@ public: /// @param force When true, delete is done without checking for /// dependent options. /// @return Number of deleted option definitions. + /// @throw NotImplemented if server selector is "unassigned". /// @throw InvalidOperation if force is false and there is an option /// matching server, code, and space. uint64_t deleteOptionDef4(const ServerSelector& server_selector, @@ -2207,7 +2208,7 @@ public: auto option = getOption(GET_OPTION4_CODE_SPACE, Option::V4, server_selector, code, space); if (option) { - isc_throw(InvalidOperation, "option exists for option defintion: " + isc_throw(InvalidOperation, "option exists for option definition: " << space << "." << code); } } diff --git a/src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc b/src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc index ce1f36773c..6b337da757 100644 --- a/src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc +++ b/src/hooks/dhcp/mysql/mysql_cb_dhcp6.cc @@ -2589,7 +2589,7 @@ public: auto option = getOption(GET_OPTION6_CODE_SPACE, Option::V6, server_selector, code, space); if (option) { - isc_throw(InvalidOperation, "option exists for option defintion: " + isc_throw(InvalidOperation, "option exists for option definition: " << space << "." << code); } } @@ -4684,7 +4684,7 @@ uint64_t MySqlConfigBackendDHCPv6::deleteOptionDef6(const ServerSelector& server_selector, const uint16_t code, const std::string& space, - bool force /* = false*/) { + bool force /* = false */) { LOG_DEBUG(mysql_cb_logger, DBGLVL_TRACE_BASIC, MYSQL_CB_DELETE_OPTION_DEF6) .arg(code).arg(space); uint64_t result = impl_->deleteOptionDef6(server_selector, code, space, force); diff --git a/src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc b/src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc index d7a8a87083..fc2ef2d81c 100644 --- a/src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc +++ b/src/hooks/dhcp/pgsql/pgsql_cb_dhcp4.cc @@ -2059,6 +2059,7 @@ public: /// @param force When true, delete is done without checking for /// dependent options. /// @return Number of deleted option definitions. + /// @throw NotImplemented if server selector is "unassigned". /// @throw InvalidOperation if force is false and there is an option /// matching server, code, and space. uint64_t deleteOptionDef4(const ServerSelector& server_selector, @@ -2069,7 +2070,7 @@ public: auto option = getOption(GET_OPTION4_CODE_SPACE, Option::V4, server_selector, code, space); if (option) { - isc_throw(InvalidOperation, "option exists for option defintion: " + isc_throw(InvalidOperation, "option exists for option definition: " << space << "." << code); } } diff --git a/src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc b/src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc index 268d474523..e5edc18f0b 100644 --- a/src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc +++ b/src/hooks/dhcp/pgsql/pgsql_cb_dhcp6.cc @@ -2363,6 +2363,7 @@ public: /// @param force When true, delete is done without checking for /// dependent options. /// @return Number of deleted option definitions. + /// @throw NotImplemented if server selector is "unassigned". /// @throw InvalidOperation if force is false and there is an option /// matching server, code, and space. uint64_t deleteOptionDef6(const ServerSelector& server_selector, @@ -2373,7 +2374,7 @@ public: auto option = getOption(GET_OPTION6_CODE_SPACE, Option::V6, server_selector, code, space); if (option) { - isc_throw(InvalidOperation, "option exists for option defintion: " + isc_throw(InvalidOperation, "option exists for option definition: " << space << "." << code); } } diff --git a/src/lib/dhcpsrv/cfg_option.cc b/src/lib/dhcpsrv/cfg_option.cc index 213a748115..bccf7bb561 100644 --- a/src/lib/dhcpsrv/cfg_option.cc +++ b/src/lib/dhcpsrv/cfg_option.cc @@ -215,7 +215,7 @@ CfgOption::createDescriptorOption(CfgOptionDefPtr cfg_def, const std::string& sp Option::Universe universe = opt_desc.option_->getUniverse(); uint16_t code = opt_desc.option_->getType(); - // Find the option's defintion, if it has one. + // Find the option's definition, if it has one. // First, check for a standard definition. OptionDefinitionPtr def = LibDHCP::getOptionDef(space, code); diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index a9083a52dd..81806625e5 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -1024,8 +1024,8 @@ pose a security risk. % DHCPSRV_CFGMGR_OPTION_DEFINITION_MISMATCH failed to create option: %1 This warning message is issued when an option has been specified for which -there is no suitable option definition. Either there is no defintion at all -or the option contents do not fit the option defintion. The argument will +there is no suitable option definition. Either there is no definition at all +or the option contents do not fit the option definition. The argument will provide a detailed reason for the failure. The server will continue to operate but it will exclude the option from packet processing until the situation is corrected. This is considered a configuration error. diff --git a/src/lib/dhcpsrv/tests/cfg_option_unittest.cc b/src/lib/dhcpsrv/tests/cfg_option_unittest.cc index fa34d51b21..f700b5e764 100644 --- a/src/lib/dhcpsrv/tests/cfg_option_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfg_option_unittest.cc @@ -607,7 +607,7 @@ TEST_F(CfgOptionTest, mergeInvalid) { CfgOption this_cfg; CfgOption other_cfg; - // Create an empty dictionary of defintions pass into option merge. + // Create an empty dictionary of definitions pass into option merge. CfgOptionDefPtr defs(new CfgOptionDef()); // Create our other config that will be merged from. diff --git a/src/lib/dhcpsrv/testutils/alloc_engine_utils.cc b/src/lib/dhcpsrv/testutils/alloc_engine_utils.cc index 23be091ba2..f51edf624b 100644 --- a/src/lib/dhcpsrv/testutils/alloc_engine_utils.cc +++ b/src/lib/dhcpsrv/testutils/alloc_engine_utils.cc @@ -347,7 +347,7 @@ AllocEngine6Test::simpleAlloc6Test(const Pool6Ptr& pool, const IOAddress& hint, subnet_->setValid(Triplet(300, 400, 500)); if (class_def) { - std::cout << "adding class defintion" << std::endl; + std::cout << "adding class definition" << std::endl; CfgMgr::instance().getStagingCfg()->getClientClassDictionary()->addClass(class_def); ctx.query_->addClass(class_def->getName()); } diff --git a/src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc b/src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc index ecb0d00a97..2a78e83b44 100644 --- a/src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc +++ b/src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.cc @@ -5141,15 +5141,14 @@ GenericConfigBackendDHCPv4Test::poolOption4WithClientClassesTest() { void GenericConfigBackendDHCPv4Test::optionDef4DeleteForceTest() { - /// @brief This test verifies that option defintion delete: - /// 1. Does not delete a defintion if the force parameter is omitted and a + /// @brief This test verifies that option definition delete: + /// 1. Does not delete a definition if the force parameter is omitted and a /// dependent option exists. - /// 2. Does not delete a defintion if the force parameter is false and a + /// 2. Does not delete a definition if the force parameter is false and a /// dependent option exists. - /// 3. Deletes a defintion if the force parameter is true and a + /// 3. Deletes a definition if the force parameter is true and a /// dependent option exists. - // Create an option definition. OptionDefinitionPtr option_def(new OptionDefinition("foo", 234, DHCP4_OPTION_SPACE, @@ -5165,19 +5164,19 @@ GenericConfigBackendDHCPv4Test::optionDef4DeleteForceTest() { ASSERT_NO_THROW_LOG(cbptr_->createUpdateOption4(ServerSelector::ALL(), option)); - // Attempting to delete the defintion should fail by default. + // Attempting to delete the definition should fail by default. uint64_t deleted_num = 0; ASSERT_THROW_MSG(deleted_num = cbptr_->deleteOptionDef4(ServerSelector::ALL(), 234, DHCP4_OPTION_SPACE), - InvalidOperation, "option exists for option defintion: dhcp4.234"); + InvalidOperation, "option exists for option definition: dhcp4.234"); EXPECT_EQ(0, deleted_num); ASSERT_THROW_MSG(deleted_num = cbptr_->deleteOptionDef4(ServerSelector::ALL(), 234, DHCP4_OPTION_SPACE, false), - InvalidOperation, "option exists for option defintion: dhcp4.234"); + InvalidOperation, "option exists for option definition: dhcp4.234"); EXPECT_EQ(0, deleted_num); ASSERT_NO_THROW_LOG(deleted_num = cbptr_->deleteOptionDef4(ServerSelector::ALL(), - 234, DHCP4_OPTION_SPACE, true)); + 234, DHCP4_OPTION_SPACE, true)); EXPECT_EQ(1, deleted_num); } diff --git a/src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.h b/src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.h index 156bb3e481..a96f29c63e 100644 --- a/src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.h +++ b/src/lib/dhcpsrv/testutils/generic_cb_dhcp4_unittest.h @@ -400,12 +400,12 @@ public: /// by their client-classes content. void poolOption4WithClientClassesTest(); - /// @brief This test verifies that option defintion delete: - /// 1. Does not delete a defintion if the force parameter is omitted and a + /// @brief This test verifies that option definition delete: + /// 1. Does not delete a definition if the force parameter is omitted and a /// dependent option exists. - /// 2. Does not delete a defintion if the force parameter is false and a + /// 2. Does not delete a definition if the force parameter is false and a /// dependent option exists. - /// 3. Deletes a defintion if the force parameter is true and a + /// 3. Deletes a definition if the force parameter is true and a /// dependent option exists. void optionDef4DeleteForceTest(); diff --git a/src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.cc b/src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.cc index 53c825db99..ce561bf7ba 100644 --- a/src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.cc +++ b/src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.cc @@ -5390,6 +5390,14 @@ GenericConfigBackendDHCPv6Test::pdPoolOption6WithClientClassesTest() { void GenericConfigBackendDHCPv6Test::optionDef6DeleteForceTest() { + /// @brief This test verifies that option definition delete: + /// 1. Does not delete a definition if the force parameter is omitted and a + /// dependent option exists. + /// 2. Does not delete a definition if the force parameter is false and a + /// dependent option exists. + /// 3. Deletes a definition if the force parameter is true and a + /// dependent option exists. + // Create an option definition. OptionDefinitionPtr option_def(new OptionDefinition("foo", 700, DHCP6_OPTION_SPACE, @@ -5405,19 +5413,19 @@ GenericConfigBackendDHCPv6Test::optionDef6DeleteForceTest() { ASSERT_NO_THROW_LOG(cbptr_->createUpdateOption6(ServerSelector::ALL(), option)); - // Attempting to delete the defintion should fail by default. + // Attempting to delete the definition should fail by default. uint64_t deleted_num = 0; ASSERT_THROW_MSG(deleted_num = cbptr_->deleteOptionDef6(ServerSelector::ALL(), 700, DHCP6_OPTION_SPACE), - InvalidOperation, "option exists for option defintion: dhcp6.700"); + InvalidOperation, "option exists for option definition: dhcp6.700"); EXPECT_EQ(0, deleted_num); ASSERT_THROW_MSG(deleted_num = cbptr_->deleteOptionDef6(ServerSelector::ALL(), 700, DHCP6_OPTION_SPACE, false), - InvalidOperation, "option exists for option defintion: dhcp6.700"); + InvalidOperation, "option exists for option definition: dhcp6.700"); EXPECT_EQ(0, deleted_num); ASSERT_NO_THROW_LOG(deleted_num = cbptr_->deleteOptionDef6(ServerSelector::ALL(), - 700, DHCP6_OPTION_SPACE, true)); + 700, DHCP6_OPTION_SPACE, true)); EXPECT_EQ(1, deleted_num); } diff --git a/src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.h b/src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.h index 919fd781cb..98c78eb8ec 100644 --- a/src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.h +++ b/src/lib/dhcpsrv/testutils/generic_cb_dhcp6_unittest.h @@ -409,12 +409,12 @@ public: /// by their client-classes content. void pdPoolOption6WithClientClassesTest(); - /// @brief This test verifies that option defintion delete: - /// 1. Does not delete a defintion if the force parameter is omitted and a + /// @brief This test verifies that option definition delete: + /// 1. Does not delete a definition if the force parameter is omitted and a /// dependent option exists. - /// 2. Does not delete a defintion if the force parameter is false and a + /// 2. Does not delete a definition if the force parameter is false and a /// dependent option exists. - /// 3. Deletes a defintion if the force parameter is true and a + /// 3. Deletes a definition if the force parameter is true and a /// dependent option exists. void optionDef6DeleteForceTest(); diff --git a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc index e368ac1f9e..7280a5bf76 100644 --- a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc +++ b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp4.cc @@ -1155,7 +1155,7 @@ TestConfigBackendDHCPv4::deleteOptionDef4(const db::ServerSelector& server_selec if (!force) { auto option = getOption4(server_selector, code, space); if (option) { - isc_throw(InvalidOperation, "option exists for option definition: " + isc_throw(InvalidOperation, "option exists for option definition: " << space << "." << code); } } diff --git a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc index 85e7953ed0..3e7db69665 100644 --- a/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc +++ b/src/lib/dhcpsrv/testutils/test_config_backend_dhcp6.cc @@ -1212,7 +1212,6 @@ TestConfigBackendDHCPv6::deleteOptionDef6(const db::ServerSelector& server_selec if (option) { isc_throw(InvalidOperation, "option exists for option definition: " << space << "." << code); - } } diff --git a/src/lib/yang/adaptor_option.h b/src/lib/yang/adaptor_option.h index 6acbeefed2..f9c33274c8 100644 --- a/src/lib/yang/adaptor_option.h +++ b/src/lib/yang/adaptor_option.h @@ -55,7 +55,7 @@ public: /// @throw MissingKey if the type is not present. static void checkType(isc::data::ConstElementPtr option); - /// @brief Check if code is specified in option defintion. + /// @brief Check if code is specified in option definition. /// /// @param option The option. /// @throw MissingKey if the code is not present. diff --git a/src/share/api/remote-option-def4-del.json b/src/share/api/remote-option-def4-del.json index a2c497266d..128558b31f 100644 --- a/src/share/api/remote-option-def4-del.json +++ b/src/share/api/remote-option-def4-del.json @@ -5,7 +5,7 @@ "This command deletes a DHCPv4 option definition from the configuration database." ], "cmd-comment": [ - "This command includes a list with exactly one option definition specification, comprising an option name and code. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. As of Kea 3.1.2, before deleting an option definition, the server will first check if there are any options specified that depend upon that defintion. If so the delete command will be rejected with an error message explaining why. This default behavior may be overridden by setting the optional ``force`` parameter to true." + "This command includes a list with exactly one option definition specification, comprising an option name and code. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. As of Kea 3.1.2, before deleting an option definition, the server will first check if there are any options specified that depend upon that definition. If so the delete command will be rejected with an error message explaining why. This default behavior may be overridden by setting the optional ``force`` parameter to true." ], "cmd-syntax": [ "{", diff --git a/src/share/api/remote-option-def6-del.json b/src/share/api/remote-option-def6-del.json index 5e31a50a10..4e2840c172 100644 --- a/src/share/api/remote-option-def6-del.json +++ b/src/share/api/remote-option-def6-del.json @@ -5,7 +5,7 @@ "This command deletes a DHCPv6 option definition from the configuration database." ], "cmd-comment": [ - "This command includes a list with exactly one option definition specification, comprising an option name and code. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. As of Kea 3.1.2, before deleting an option definition, the server will first check if there are any options specified that depend upon that defintion. If so the delete command will be rejected with an error message explaining why. This default behavior may be overridden by setting the optional ``force`` parameter to true." + "This command includes a list with exactly one option definition specification, comprising an option name and code. The ``server-tags`` list is mandatory and must contain exactly one server tag. Specifying an empty list, a value of ``null``, or multiple server tags will result in an error. As of Kea 3.1.2, before deleting an option definition, the server will first check if there are any options specified that depend upon that definition. If so the delete command will be rejected with an error message explaining why. This default behavior may be overridden by setting the optional ``force`` parameter to true." ], "cmd-syntax": [ "{", -- 2.47.3