mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-22 18:08:16 +00:00
[#3831] Checkpoint: fixes
This commit is contained in:
parent
01dc6e538c
commit
e8d9560f43
@ -828,6 +828,9 @@ TEST_F(CtrlAgentControllerTest, configWrite) {
|
||||
// Now clean up after ourselves.
|
||||
ctrl->registerCommands();
|
||||
|
||||
// Add a config file.
|
||||
ctrl->setConfigFile(string(TEST_DATA_BUILDDIR) + string("/config.json"));
|
||||
|
||||
// First, build the command:
|
||||
string file = string(TEST_DATA_BUILDDIR) + string("/config-write.json");
|
||||
string cmd_txt = "{ \"command\": \"config-write\" }";
|
||||
|
@ -298,9 +298,10 @@ ControlledDhcpv4Srv::commandConfigWriteHandler(const string&,
|
||||
try {
|
||||
checkWriteConfigFile(filename);
|
||||
} catch (const isc::Exception& ex) {
|
||||
return (createAnswer(CONTROL_RESULT_ERROR,
|
||||
string("not allowed to write config into ") +
|
||||
filename));
|
||||
std::ostringstream msg;
|
||||
msg << "not allowed to write config into " << filename
|
||||
<< ": " << ex.what();
|
||||
return (createAnswer(CONTROL_RESULT_ERROR, msg.str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -301,9 +301,10 @@ ControlledDhcpv6Srv::commandConfigWriteHandler(const string&,
|
||||
try {
|
||||
checkWriteConfigFile(filename);
|
||||
} catch (const isc::Exception& ex) {
|
||||
return (createAnswer(CONTROL_RESULT_ERROR,
|
||||
string("not allowed to write config into ") +
|
||||
filename));
|
||||
std::ostringstream msg;
|
||||
msg << "not allowed to write config into " << filename
|
||||
<< ": " << ex.what();
|
||||
return (createAnswer(CONTROL_RESULT_ERROR, msg.str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -512,9 +512,10 @@ DControllerBase::configWriteHandler(const std::string&,
|
||||
try {
|
||||
checkWriteConfigFile(filename);
|
||||
} catch (const isc::Exception& ex) {
|
||||
return (createAnswer(CONTROL_RESULT_ERROR,
|
||||
std::string("not allowed to write config into ") +
|
||||
filename));
|
||||
std::ostringstream msg;
|
||||
msg << "not allowed to write config into " << filename
|
||||
<< ": " << ex.what();
|
||||
return (createAnswer(CONTROL_RESULT_ERROR, msg.str()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ Daemon::checkWriteConfigFile(std::string& file) {
|
||||
return;
|
||||
}
|
||||
isc_throw(isc::BadValue, "file " << file << " must be in the same "
|
||||
<< "directory as the config file (" << config_file_ << "'");
|
||||
<< "directory as the config file (" << config_file_ << ")");
|
||||
}
|
||||
|
||||
std::string
|
||||
|
Loading…
x
Reference in New Issue
Block a user