MXS-1220: Fix minor bugs
Destroyed servers were still shown as a part of the servers resource collection. If a parameter defined in persisted configurations was replaced, the value would be appended to itself after it was replaced. Return correct error codes for internal errors. The server check was checking for old parameter locations.
This commit is contained in:
@ -819,11 +819,23 @@ static inline const char* string_or_null(json_t* json, const char* name)
|
||||
|
||||
static bool server_contains_required_fields(json_t* json)
|
||||
{
|
||||
bool rval = false;
|
||||
json_t* value;
|
||||
|
||||
return (value = json_object_get(json, CN_NAME)) && json_is_string(value) &&
|
||||
(value = json_object_get(json, CN_ADDRESS)) && json_is_string(value) &&
|
||||
(value = json_object_get(json, CN_PORT)) && json_is_integer(value);
|
||||
if ((value = json_object_get(json, CN_NAME)) && json_is_string(value))
|
||||
{
|
||||
/** Object has a name field */
|
||||
json_t* param = json_object_get(json, CN_PARAMETERS);
|
||||
|
||||
if (param &&
|
||||
(value = json_object_get(param, CN_ADDRESS)) && json_is_string(value) &&
|
||||
(value = json_object_get(param, CN_PORT)) && json_is_integer(value))
|
||||
{
|
||||
rval = true;
|
||||
}
|
||||
}
|
||||
|
||||
return rval;
|
||||
}
|
||||
|
||||
const char* server_relation_types[] =
|
||||
|
||||
Reference in New Issue
Block a user