Always load module defaults for monitors

The creation of a monitor from JSON relied on the non-JSON version for the
addition of default parameters but it proceeded to check the validity of
the parameters before it. Whenever parameters are checked, the default
parameters should be present.
This commit is contained in:
Markus Mäkelä
2019-03-27 15:01:09 +02:00
parent 548223ec9d
commit abd6e0924f

View File

@ -2346,7 +2346,12 @@ Monitor* runtime_create_monitor_from_json(json_t* json)
if (const MXS_MODULE* mod = get_module(module, MODULE_MONITOR))
{
auto params = extract_parameters(json);
MXS_CONFIG_PARAMETER params;
bool ok;
tie(ok, params) = load_defaults(module, MODULE_MONITOR, CN_MONITOR);
mxb_assert(ok);
params.set_multiple(extract_parameters(json));
if (validate_param(config_monitor_params, mod->parameters, &params)
&& server_relationship_to_parameter(json, &params))