LOG_FATAL(dhcp4_logger, DHCP4_CONFIG_UNRECOVERABLE_ERROR);
}
+ /// Let postponed hook initializations to run.
+ try {
+ getIOService()->poll();
+ } catch (const std::exception& ex) {
+ std::ostringstream err;
+ err << "Error initializing hooks: "
+ << ex.what();
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
+ }
+
return (result);
}
// Allow DB reconnect on startup. The database connection parameters specify
// respective details.
- std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
+ DbConnectionInitWithRetry retry;
// Single stream instance used in all error clauses
std::ostringstream err;
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
- dbr.reset();
-
- /// Let postponed hook initializations to run.
- try {
- ControlledDhcpv4Srv::getInstance()->getIOService()->poll();
- } catch (const std::exception& ex) {
- err << "Error initializing hooks: "
- << ex.what();
- return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
- }
-
return (answer);
}
// section which loads the callout library #4, which implements
// dhcp4_srv_configured callout and a failing start service.
string config_str =
- "{"
+ "{ \"Dhcp4\": {"
" \"interfaces-config\": {"
" \"interfaces\": [ ]"
" },"
" \"library\": \"" + std::string(CALLOUT_LIBRARY_4) + "\""
" }"
" ]"
- "}";
+ "} }";
ConstElementPtr config = Element::fromJSON(config_str);
// Configure the server.
ConstElementPtr answer;
- ASSERT_NO_THROW(answer = srv->processConfig(config));
+ ASSERT_NO_THROW(answer = srv->processCommand("config-set", config));
// Make sure there was an error with expected message.
int status_code;
LOG_FATAL(dhcp6_logger, DHCP6_CONFIG_UNRECOVERABLE_ERROR);
}
+ /// Let postponed hook initializations to run.
+ try {
+ getIOService()->poll();
+ } catch (const std::exception& ex) {
+ std::ostringstream err;
+ err << "Error initializing hooks: "
+ << ex.what();
+ return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
+ }
+
return (result);
}
// Allow DB reconnect on startup. The database connection parameters specify
// respective details.
- std::shared_ptr<DbConnectionInitWithRetry> dbr(new DbConnectionInitWithRetry());
+ DbConnectionInitWithRetry retry;
// Single stream instance used in all error clauses
std::ostringstream err;
return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
}
- dbr.reset();
-
- /// Let postponed hook initializations to run.
- try {
- ControlledDhcpv6Srv::getInstance()->getIOService()->poll();
- } catch (const std::exception& ex) {
- err << "Error initializing hooks: "
- << ex.what();
- return (isc::config::createAnswer(CONTROL_RESULT_ERROR, err.str()));
- }
-
return (answer);
}
// section which loads the callout library #4, which implements
// dhcp6_srv_configured callout and a failing start service.
string config_str =
- "{"
+ "{ \"Dhcp6\": {"
" \"interfaces-config\": {"
" \"interfaces\": [ ]"
" },"
" \"library\": \"" + std::string(CALLOUT_LIBRARY_4) + "\""
" }"
" ]"
- "}";
+ "} }";
ConstElementPtr config = Element::fromJSON(config_str);
// Configure the server.
ConstElementPtr answer;
- ASSERT_NO_THROW(answer = srv->processConfig(config));
+ ASSERT_NO_THROW(answer = srv->processCommand("config-set", config));
// Make sure there was an error with expected message.
int status_code;