Browse Source

[3534] Removed CfgMgr::getConfiguration.

Marcin Siodelski 10 years ago
parent
commit
3b2c3ac043

+ 1 - 1
src/bin/dhcp4/json_config_parser.cc

@@ -653,7 +653,7 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
     }
 
     LOG_INFO(dhcp4_logger, DHCP4_CONFIG_COMPLETE)
-        .arg(CfgMgr::instance().getConfiguration()->
+        .arg(CfgMgr::instance().getCurrent()->
              getConfigSummary(Configuration::CFGSEL_ALL4));
 
     // Everything was fine. Configuration is successful.

+ 1 - 1
src/bin/dhcp6/ctrl_dhcp6_srv.cc

@@ -144,7 +144,7 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
     // safe and we really don't want to emit exceptions to the callback caller.
     // Instead, catch an exception and create appropriate answer.
     try {
-        CfgMgr::instance().getConfiguration()->getCfgIface()
+        CfgMgr::instance().getCurrent()->getCfgIface()
             .openSockets(CfgIface::V6, srv->getPort());
 
     } catch (const std::exception& ex) {

+ 1 - 1
src/bin/dhcp6/json_config_parser.cc

@@ -854,7 +854,7 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
     }
 
     LOG_INFO(dhcp6_logger, DHCP6_CONFIG_COMPLETE)
-        .arg(CfgMgr::instance().getConfiguration()->
+        .arg(CfgMgr::instance().getCurrent()->
              getConfigSummary(Configuration::CFGSEL_ALL6));
 
     // Everything was fine. Configuration is successful.

+ 1 - 1
src/bin/dhcp6/kea_controller.cc

@@ -74,7 +74,7 @@ void configure(const std::string& file_name) {
         // If there's no logging element, we'll just pass NULL pointer,
         // which will be handled by configureLogger().
         Daemon::configureLogger(json->get("Logging"),
-                                CfgMgr::instance().getConfiguration(),
+                                CfgMgr::instance().getStaging(),
                                 ControlledDhcpv6Srv::getInstance()->getVerbose());
 
         // Get Dhcp6 component from the config

+ 0 - 5
src/lib/dhcpsrv/cfgmgr.cc

@@ -387,11 +387,6 @@ CfgMgr::rollback() {
     }
 }
 
-ConfigurationPtr
-CfgMgr::getConfiguration() {
-    return (configuration_);
-}
-
 ConstConfigurationPtr
 CfgMgr::getCurrent() {
     ensureCurrentAllocated();

+ 0 - 5
src/lib/dhcpsrv/cfgmgr.h

@@ -415,11 +415,6 @@ public:
     /// This function is exception safe.
     void rollback();
 
-    /// @brief Returns the current configuration.
-    ///
-    /// @return a pointer to the current configuration.
-    ConfigurationPtr getConfiguration();
-
     /// @brief Returns a pointer to the current configuration.
     ///
     /// This function returns pointer to the current configuration. If the

+ 4 - 1
src/lib/dhcpsrv/tests/cfgmgr_unittest.cc

@@ -295,9 +295,12 @@ public:
 // it is empty by default.
 TEST_F(CfgMgrTest, configuration) {
 
-    ConfigurationPtr configuration = CfgMgr::instance().getConfiguration();
+    ConstConfigurationPtr configuration = CfgMgr::instance().getCurrent();
     ASSERT_TRUE(configuration);
+    EXPECT_TRUE(configuration->getLoggingInfo().empty());
 
+    configuration = CfgMgr::instance().getStaging();
+    ASSERT_TRUE(configuration);
     EXPECT_TRUE(configuration->getLoggingInfo().empty());
 }