}
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.
// 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) {
}
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.
// 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
}
}
-ConfigurationPtr
-CfgMgr::getConfiguration() {
- return (configuration_);
-}
-
ConstConfigurationPtr
CfgMgr::getCurrent() {
ensureCurrentAllocated();
/// 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
// 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());
}