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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user