Commit ee50101f authored by Francis Dupont's avatar Francis Dupont

[5033] Some fixes (1,2,4 of review)

parent d7114906
......@@ -20,6 +20,7 @@ nobase_dist_doc_DATA += examples/kea4/pgsql-reservations.json
nobase_dist_doc_DATA += examples/kea4/reservations.json
nobase_dist_doc_DATA += examples/kea4/several-subnets.json
nobase_dist_doc_DATA += examples/kea4/single-subnet.json
nobase_dist_doc_DATA += examples/kea4/with-ddns.json
nobase_dist_doc_DATA += examples/kea6/advanced.json
nobase_dist_doc_DATA += examples/kea6/backends.json
nobase_dist_doc_DATA += examples/kea6/classify.json
......@@ -35,6 +36,7 @@ nobase_dist_doc_DATA += examples/kea6/several-subnets.json
nobase_dist_doc_DATA += examples/kea6/simple.json
nobase_dist_doc_DATA += examples/kea6/softwire46.json
nobase_dist_doc_DATA += examples/kea6/stateless.json
nobase_dist_doc_DATA += examples/kea6/with-ddns.json
devel:
mkdir -p html
......
......@@ -187,6 +187,8 @@ public:
///< Used while parsing content of Dhcp4.
DHCP4,
// not yet DHCP6,
///< Used while parsing content of Logging
LOGGING,
......
......@@ -123,17 +123,9 @@ size_t SimpleParser4::setAllDefaults(isc::data::ElementPtr global) {
ConstElementPtr d2_client = global->get("dhcp-ddns");
/// @todo - what if it's not in global? should we add it?
if (d2_client) {
// Because "dhcp-ddns" is a MapElement and global->get()
// returns a ConstElementPtr, then we get a map we can't
// change. So go thru gyrations to create a non-const
// map, update it with default values and then replace
// the one in global with the new one. Ick.
std::map<std::string, ConstElementPtr> d2_map;
d2_client->getValue(d2_map);
ElementPtr new_map(new MapElement());
new_map->setValue(d2_map);
cnt += SimpleParser::setDefaults(new_map, D2_CLIENT_CONFIG_DEFAULTS);
global->set("dhcp-ddns", new_map);
// Get the mutable form of d2 client config
ElementPtr mutable_d2 = boost::const_pointer_cast<Element>(d2_client);
cnt += SimpleParser::setDefaults(mutable_d2, D2_CLIENT_CONFIG_DEFAULTS);
}
return (cnt);
......
......@@ -191,7 +191,6 @@ public:
DHCP6,
// not yet DHCP4,
// not yet DHCP_DDNS,
///< Used while parsing content of Logging
LOGGING,
......
......@@ -125,17 +125,9 @@ size_t SimpleParser6::setAllDefaults(isc::data::ElementPtr global) {
ConstElementPtr d2_client = global->get("dhcp-ddns");
/// @todo - what if it's not in global? should we add it?
if (d2_client) {
// Because "dhcp-ddns" is a MapElement and global->get()
// returns a ConstElementPtr, then we get a map we can't
// change. So go thru gyrations to create a non-const
// map, update it with default values and then replace
// the one in global with the new one. Ick.
std::map<std::string, ConstElementPtr> d2_map;
d2_client->getValue(d2_map);
ElementPtr new_map(new MapElement());
new_map->setValue(d2_map);
cnt += SimpleParser::setDefaults(new_map, D2_CLIENT_CONFIG_DEFAULTS);
global->set("dhcp-ddns", new_map);
// Get the mutable form of d2 client config
ElementPtr mutable_d2 = boost::const_pointer_cast<Element>(d2_client);
cnt += SimpleParser::setDefaults(mutable_d2, D2_CLIENT_CONFIG_DEFAULTS);
}
return (cnt);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment