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

[#92,!13] Moved DbAccessParser to libkea-database.

This commit is contained in:
Marcin Siodelski
2018-08-29 10:52:41 +02:00
parent 4b2ea5f14e
commit 11f9193ef8
5 changed files with 50 additions and 39 deletions

View File

@@ -429,25 +429,31 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
// Please move at the end when migration will be finished.
if (config_pair.first == "lease-database") {
DbAccessParser parser(DBType::LEASE_DB);
DbAccessParser parser;
std::string access_string;
parser.parse(access_string, config_pair.second);
CfgDbAccessPtr cfg_db_access = srv_cfg->getCfgDbAccess();
parser.parse(cfg_db_access, config_pair.second);
cfg_db_access->setLeaseDbAccessString(access_string);
continue;
}
if (config_pair.first == "hosts-database") {
DbAccessParser parser(DBType::HOSTS_DB);
DbAccessParser parser;
std::string access_string;
parser.parse(access_string, config_pair.second);
CfgDbAccessPtr cfg_db_access = srv_cfg->getCfgDbAccess();
parser.parse(cfg_db_access, config_pair.second);
cfg_db_access->setHostDbAccessString(access_string);
continue;
}
if (config_pair.first == "hosts-databases") {
CfgDbAccessPtr cfg_db_access = srv_cfg->getCfgDbAccess();
DbAccessParser parser(DBType::HOSTS_DB);
DbAccessParser parser;
auto list = config_pair.second->listValue();
for (auto it : list) {
parser.parse(cfg_db_access, it);
std::string access_string;
parser.parse(access_string, it);
cfg_db_access->setHostDbAccessString(access_string);
}
continue;
}