Commit ee50101f authored by Francis Dupont's avatar Francis Dupont
Browse files

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

parent d7114906
...@@ -20,6 +20,7 @@ nobase_dist_doc_DATA += examples/kea4/pgsql-reservations.json ...@@ -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/reservations.json
nobase_dist_doc_DATA += examples/kea4/several-subnets.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/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/advanced.json
nobase_dist_doc_DATA += examples/kea6/backends.json nobase_dist_doc_DATA += examples/kea6/backends.json
nobase_dist_doc_DATA += examples/kea6/classify.json nobase_dist_doc_DATA += examples/kea6/classify.json
...@@ -35,6 +36,7 @@ nobase_dist_doc_DATA += examples/kea6/several-subnets.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/simple.json
nobase_dist_doc_DATA += examples/kea6/softwire46.json nobase_dist_doc_DATA += examples/kea6/softwire46.json
nobase_dist_doc_DATA += examples/kea6/stateless.json nobase_dist_doc_DATA += examples/kea6/stateless.json
nobase_dist_doc_DATA += examples/kea6/with-ddns.json
devel: devel:
mkdir -p html mkdir -p html
......
...@@ -187,6 +187,8 @@ public: ...@@ -187,6 +187,8 @@ public:
///< Used while parsing content of Dhcp4. ///< Used while parsing content of Dhcp4.
DHCP4, DHCP4,
// not yet DHCP6,
///< Used while parsing content of Logging ///< Used while parsing content of Logging
LOGGING, LOGGING,
......
...@@ -123,17 +123,9 @@ size_t SimpleParser4::setAllDefaults(isc::data::ElementPtr global) { ...@@ -123,17 +123,9 @@ size_t SimpleParser4::setAllDefaults(isc::data::ElementPtr global) {
ConstElementPtr d2_client = global->get("dhcp-ddns"); ConstElementPtr d2_client = global->get("dhcp-ddns");
/// @todo - what if it's not in global? should we add it? /// @todo - what if it's not in global? should we add it?
if (d2_client) { if (d2_client) {
// Because "dhcp-ddns" is a MapElement and global->get() // Get the mutable form of d2 client config
// returns a ConstElementPtr, then we get a map we can't ElementPtr mutable_d2 = boost::const_pointer_cast<Element>(d2_client);
// change. So go thru gyrations to create a non-const cnt += SimpleParser::setDefaults(mutable_d2, D2_CLIENT_CONFIG_DEFAULTS);
// 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);
} }
return (cnt); return (cnt);
......
...@@ -191,7 +191,6 @@ public: ...@@ -191,7 +191,6 @@ public:
DHCP6, DHCP6,
// not yet DHCP4, // not yet DHCP4,
// not yet DHCP_DDNS,
///< Used while parsing content of Logging ///< Used while parsing content of Logging
LOGGING, LOGGING,
......
...@@ -125,17 +125,9 @@ size_t SimpleParser6::setAllDefaults(isc::data::ElementPtr global) { ...@@ -125,17 +125,9 @@ size_t SimpleParser6::setAllDefaults(isc::data::ElementPtr global) {
ConstElementPtr d2_client = global->get("dhcp-ddns"); ConstElementPtr d2_client = global->get("dhcp-ddns");
/// @todo - what if it's not in global? should we add it? /// @todo - what if it's not in global? should we add it?
if (d2_client) { if (d2_client) {
// Because "dhcp-ddns" is a MapElement and global->get() // Get the mutable form of d2 client config
// returns a ConstElementPtr, then we get a map we can't ElementPtr mutable_d2 = boost::const_pointer_cast<Element>(d2_client);
// change. So go thru gyrations to create a non-const cnt += SimpleParser::setDefaults(mutable_d2, D2_CLIENT_CONFIG_DEFAULTS);
// 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);
} }
return (cnt); return (cnt);
......
Supports Markdown
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