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:
.. 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.
/// @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,
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);
}
}
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);
}
}
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);
/// @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,
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);
}
}
/// @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,
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);
}
}
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);
% 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.
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.
subnet_->setValid(Triplet<uint32_t>(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());
}
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,
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);
}
/// 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();
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,
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);
}
/// 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();
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);
}
}
if (option) {
isc_throw(InvalidOperation, "option exists for option definition: "
<< space << "." << code);
-
}
}
/// @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.
"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": [
"{",
"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": [
"{",