2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[5122] Obsolete ParserContext class removed.

This commit is contained in:
Tomek Mrugalski
2017-01-27 20:42:16 +01:00
parent 8acb679084
commit d3bfac3329
9 changed files with 16 additions and 608 deletions

View File

@@ -423,9 +423,6 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND,
DHCP4_CONFIG_START).arg(config_set->str());
// Reset global context.
globalContext().reset(new ParserContext(Option::V4));
// Before starting any subnet operations, let's reset the subnet-id counter,
// so newly recreated configuration starts with first subnet-id equal 1.
Subnet::resetSubnetID();
@@ -444,15 +441,6 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
// the same risk of failure as doing the change.)
HooksLibrariesParser hooks_parser;
// The subnet parsers implement data inheritance by directly
// accessing global storage. For this reason the global data
// parsers must store the parsed data into global storages
// immediately. This may cause data inconsistency if the
// parsing operation fails after the global storage has been
// modified. We need to preserve the original global data here
// so as we can rollback changes when an error occurs.
ParserContext original_context(*globalContext());
// Answer will hold the result.
ConstElementPtr answer;
// Rollback informs whether error occurred and original data
@@ -661,7 +649,6 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
// Rollback changes as the configuration parsing failed.
if (rollback) {
globalContext().reset(new ParserContext(original_context));
// Revert to original configuration of runtime option definitions
// in the libdhcp++.
LibDHCP::revertRuntimeOptionDefs();
@@ -677,10 +664,5 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
return (answer);
}
ParserContextPtr& globalContext() {
static ParserContextPtr global_context_ptr(new ParserContext(Option::V4));
return (global_context_ptr);
}
}; // end of isc::dhcp namespace
}; // end of isc namespace