From 8873fce8a2485e1889c26ce6b18a5c6a41cb7bc6 Mon Sep 17 00:00:00 2001 From: Thomas Markwalder Date: Mon, 18 Mar 2019 11:30:05 -0400 Subject: [PATCH] [#401,!254] Addressed more review comments. --- src/lib/dhcpsrv/cfg_option.h | 13 +++++++++++++ src/lib/dhcpsrv/tests/cfg_option_unittest.cc | 1 - 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/dhcpsrv/cfg_option.h b/src/lib/dhcpsrv/cfg_option.h index f6b2ee80cc..060c940ea0 100644 --- a/src/lib/dhcpsrv/cfg_option.h +++ b/src/lib/dhcpsrv/cfg_option.h @@ -333,6 +333,19 @@ public: /// @throw isc::BadValue if the option space is invalid. void add(const OptionDescriptor& desc, const std::string& option_space); + /// @brief Replaces the instance of an option within this collection + /// + /// This method locates the option within the given space and replaces + /// it with a copy of the given descriptor. This effectively updates + /// the contents without altering the container indexing. + /// + /// @param desc Option descriptor holding option instance and other + /// parameters pertaining to the option. + /// @param option_space Option space name. + /// + /// @throw isc::BadValue if the descriptor's option instance is null, + /// if space is invalid, or if the option does not already exist + /// in the given space. void replace(const OptionDescriptor& desc, const std::string& option_space); /// @brief Merges another option configuration into this one. diff --git a/src/lib/dhcpsrv/tests/cfg_option_unittest.cc b/src/lib/dhcpsrv/tests/cfg_option_unittest.cc index d53ddb35b2..b820305bc7 100644 --- a/src/lib/dhcpsrv/tests/cfg_option_unittest.cc +++ b/src/lib/dhcpsrv/tests/cfg_option_unittest.cc @@ -546,7 +546,6 @@ TEST_F(CfgOptionTest, createDescriptorOptionValid) { ASSERT_NO_THROW(updated = CfgOption::createDescriptorOption(defs, space, *desc)); ASSERT_TRUE(updated); - std::cout << "option:" << desc->option_->toText() << std::endl; Option4AddrLstPtr opaddrs = boost::dynamic_pointer_cast(desc->option_); ASSERT_TRUE(opaddrs); EXPECT_EQ("type=002, len=008: 192.0.2.1 192.0.2.2", opaddrs->toText()); -- 2.47.2