2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[3534] Basic implementation of staging and rolling back configurations.

This commit is contained in:
Marcin Siodelski
2014-08-29 09:28:30 +02:00
parent 135e6a4536
commit 59cd21bb28
21 changed files with 349 additions and 160 deletions

View File

@@ -443,7 +443,7 @@ namespace dhcp {
parser = new Uint32Parser(config_id,
globalContext()->uint32_values_);
} else if (config_id.compare("interfaces") == 0) {
parser = new InterfaceListConfigParser(config_id);
parser = new InterfaceListConfigParser(config_id, globalContext());
} else if (config_id.compare("subnet4") == 0) {
parser = new Subnets4ListConfigParser(config_id);
} else if (config_id.compare("option-data") == 0) {
@@ -619,9 +619,8 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
subnet_parser->commit();
}
if (iface_parser) {
iface_parser->commit();
}
// No need to commit interface names as this is handled by the
// CfgMgr::commit() function.
// Apply global options
commitGlobalOptions();
@@ -649,6 +648,7 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
// Rollback changes as the configuration parsing failed.
if (rollback) {
globalContext().reset(new ParserContext(original_context));
CfgMgr::instance().rollback();
return (answer);
}