mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 06:25:34 +00:00
[#2707] config-set in v4 now returns hash
This commit is contained in:
@@ -974,8 +974,14 @@ configureDhcp4Server(Dhcpv4Srv& server, isc::data::ConstElementPtr config_set,
|
||||
.arg(CfgMgr::instance().getStagingCfg()->
|
||||
getConfigSummary(SrvConfig::CFGSEL_ALL4));
|
||||
|
||||
// Also calculate SHA256 hash of the config that was just set and append it to the response.
|
||||
ElementPtr config = CfgMgr::instance().getCurrentCfg()->toElement();
|
||||
string hash = BaseCommandMgr::getHash(config);
|
||||
ElementPtr hash_map = Element::createMap();
|
||||
hash_map->set("hash", Element::create(hash));
|
||||
|
||||
// Everything was fine. Configuration is successful.
|
||||
answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful.");
|
||||
answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful.", hash_map);
|
||||
return (answer);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user