Commit 367db089 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[5213] Handling of parameterless commands improved

parent 725862d7
......@@ -438,15 +438,17 @@ ControlledDhcpv4Srv::commandLeasesReclaimHandler(const string&,
ConstElementPtr
ControlledDhcpv4Srv::processCommand(const string& command,
ConstElementPtr args) {
string txt = args? args->str() : "(none)";
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND, DHCP4_COMMAND_RECEIVED)
.arg(command).arg(args->str());
.arg(command).arg(txt);
ControlledDhcpv4Srv* srv = ControlledDhcpv4Srv::getInstance();
if (!srv) {
ConstElementPtr no_srv = isc::config::createAnswer(1,
"Server object not initialized, so can't process command '" +
command + "', arguments: '" + args->str() + "'.");
command + "', arguments: '" + txt + "'.");
return (no_srv);
}
......@@ -488,7 +490,7 @@ ControlledDhcpv4Srv::processCommand(const string& command,
} catch (const Exception& ex) {
return (isc::config::createAnswer(1, "Error while processing command '"
+ command + "':" + ex.what() +
", params: '" + args->str() + "'"));
", params: '" + txt + "'"));
}
}
......
......@@ -441,15 +441,17 @@ ControlledDhcpv6Srv::commandLeasesReclaimHandler(const string&,
isc::data::ConstElementPtr
ControlledDhcpv6Srv::processCommand(const std::string& command,
isc::data::ConstElementPtr args) {
string txt = args? args->str() : "(none)";
LOG_DEBUG(dhcp6_logger, DBG_DHCP6_COMMAND, DHCP6_COMMAND_RECEIVED)
.arg(command).arg(args->str());
.arg(command).arg(txt);
ControlledDhcpv6Srv* srv = ControlledDhcpv6Srv::getInstance();
if (!srv) {
ConstElementPtr no_srv = isc::config::createAnswer(1,
"Server object not initialized, can't process command '" +
command + "'.");
command + "', arguments: '" + txt + "'.");
return (no_srv);
}
......@@ -630,18 +632,18 @@ ControlledDhcpv6Srv::processConfig(isc::data::ConstElementPtr config) {
isc::data::ConstElementPtr
ControlledDhcpv6Srv::checkConfig(isc::data::ConstElementPtr config) {
LOG_DEBUG(dhcp6_logger, DBG_DHCP6_COMMAND, DHCP6_CONFIG_RECEIVED)
.arg(config->str());
ControlledDhcpv6Srv* srv = ControlledDhcpv6Srv::getInstance();
if (!srv) {
ConstElementPtr no_srv = isc::config::createAnswer(1,
"Server object not initialized, can't process config.");
return (no_srv);
}
return (configureDhcp6Server(*srv, config, true));
}
......
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