From 9daa81fb28943585637e822aa01c6f8cc1860513 Mon Sep 17 00:00:00 2001 From: Andrei Pavel Date: Tue, 16 May 2023 12:05:52 +0300 Subject: [PATCH] [#2832] address review comments --- Makefile.am | 2 ++ src/lib/yang/translator_config.cc | 19 ++++++++++++++++--- .../modules/kea-dhcp-types@2023-05-31.yang | 2 +- .../modules/kea-dhcp6-server@2023-05-31.yang | 4 ++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Makefile.am b/Makefile.am index d8f38b8da5..6aaddfef98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -19,7 +19,9 @@ DISTCHECK_MYSQL_CONFIGURE_FLAG=@DISTCHECK_MYSQL_CONFIGURE_FLAG@ DISTCHECK_PGSQL_CONFIGURE_FLAG=@DISTCHECK_PGSQL_CONFIGURE_FLAG@ DISTCHECK_GSSAPI_CONFIGURE_FLAG=@DISTCHECK_GSSAPI_CONFIGURE_FLAG@ DISTCHECK_LIBYANG_CONFIGURE_FLAG=@DISTCHECK_LIBYANG_CONFIGURE_FLAG@ +DISTCHECK_LIBYANGCPP_CONFIGURE_FLAG=@DISTCHECK_LIBYANGCPP_CONFIGURE_FLAG@ DISTCHECK_SYSREPO_CONFIGURE_FLAG=@DISTCHECK_SYSREPO_CONFIGURE_FLAG@ +DISTCHECK_SYSREPOCPP_CONFIGURE_FLAG=@DISTCHECK_SYSREPOCPP_CONFIGURE_FLAG@ OVERALL_COVERAGE_DIR=$(abs_top_builddir)/coverage-cpp-html diff --git a/src/lib/yang/translator_config.cc b/src/lib/yang/translator_config.cc index c560b526b7..fd4d89ab1e 100644 --- a/src/lib/yang/translator_config.cc +++ b/src/lib/yang/translator_config.cc @@ -189,7 +189,6 @@ TranslatorConfig::getServerKeaDhcpCommon(DataNode const& data_node) { checkAndGetLeaf(result, data_node, "allocator"); checkAndGetLeaf(result, data_node, "cache-max-age"); - checkAndGetLeaf(result, data_node, "cache-max-age"); checkAndGetLeaf(result, data_node, "cache-threshold"); checkAndGetLeaf(result, data_node, "calculate-tee-times"); checkAndGetLeaf(result, data_node, "dhcp4o6-port"); @@ -237,8 +236,6 @@ TranslatorConfig::getServerKeaDhcpCommon(DataNode const& data_node) { checkAndGet(result, data_node, "compatibility", [&](DataNode const& node) -> ElementPtr const { ElementPtr compatibility(Element::createMap()); - checkAndGetLeaf(compatibility, node, "exclude-first-last-24"); - checkAndGetLeaf(compatibility, node, "ignore-dhcp-server-identifier"); checkAndGetLeaf(compatibility, node, "ignore-rai-link-selection"); checkAndGetLeaf(compatibility, node, "lenient-option-parsing"); return compatibility; @@ -345,6 +342,22 @@ TranslatorConfig::getServerKeaDhcp4() { checkAndGetLeaf(result, config, "offer-lifetime"); checkAndGetLeaf(result, config, "server-hostname"); + checkAndGet(result, config, "compatibility", + [&](DataNode const& node) -> ElementPtr const { + // If it exists, add to the existing compatibility map created in getServerKeaDhcpCommon. + ConstElementPtr const_compatibility(result->get("compatibility")); + ElementPtr compatibility; + if (const_compatibility) { + compatibility = copy(const_compatibility); + } else { + compatibility = Element::createMap(); + } + + checkAndGetLeaf(compatibility, node, "exclude-first-last-24"); + checkAndGetLeaf(compatibility, node, "ignore-dhcp-server-identifier"); + return compatibility; + }); + // Handle interfaces. ElementPtr interfaces_config(getInterfacesKea(config)); if (interfaces_config) { diff --git a/src/share/yang/modules/kea-dhcp-types@2023-05-31.yang b/src/share/yang/modules/kea-dhcp-types@2023-05-31.yang index 2daca51164..894e12b967 100644 --- a/src/share/yang/modules/kea-dhcp-types@2023-05-31.yang +++ b/src/share/yang/modules/kea-dhcp-types@2023-05-31.yang @@ -1228,7 +1228,7 @@ module kea-dhcp-types { leaf pd-allocator { type string; description - "the allocation strategy for delegted prefixes"; + "the allocation strategy for delegated prefixes"; } } diff --git a/src/share/yang/modules/kea-dhcp6-server@2023-05-31.yang b/src/share/yang/modules/kea-dhcp6-server@2023-05-31.yang index b1d1363991..18ea0c7182 100644 --- a/src/share/yang/modules/kea-dhcp6-server@2023-05-31.yang +++ b/src/share/yang/modules/kea-dhcp6-server@2023-05-31.yang @@ -21,8 +21,8 @@ module kea-dhcp6-server { used to configure and manage a Kea DHCPv6 server."; revision 2023-05-31 { - description "Added allocator, ddns-ttl-percent, offer-lifetime, - pd-allocator, read-timeout, tcp-user-timeout, write-timeout. + description "Added allocator, ddns-ttl-percent, pd-allocator, + read-timeout, tcp-user-timeout, write-timeout. Removed contact-points, keyspace."; } -- 2.47.3