Bug 494 - remove error log report for missing servers for debugcli and cli router
This commit is contained in:
@ -35,6 +35,8 @@
|
||||
* 23/05/14 Massimiliano Pinto Added automatic set of maxscale-id: first listening ipv4_raw + port + pid
|
||||
* 28/05/14 Massimiliano Pinto Added detect_replication_lag parameter
|
||||
* 28/08/14 Massimiliano Pinto Added detect_stale_master parameter
|
||||
* 12/09/14 Mark Riddoch Addition of checks on servers list and
|
||||
* internal router suppression of messages
|
||||
*
|
||||
* @endverbatim
|
||||
*/
|
||||
@ -62,6 +64,7 @@ static int handle_global_item(const char *, const char *);
|
||||
static void global_defaults();
|
||||
static void check_config_objects(CONFIG_CONTEXT *context);
|
||||
static int config_truth_value(char *str);
|
||||
static int internalService(char *router);
|
||||
|
||||
static char *config_file = NULL;
|
||||
static GATEWAY_CONF gateway;
|
||||
@ -605,11 +608,13 @@ int error_count = 0;
|
||||
{
|
||||
char *servers;
|
||||
char *roptions;
|
||||
char *router;
|
||||
char *filters = config_get_value(obj->parameters,
|
||||
"filters");
|
||||
servers = config_get_value(obj->parameters, "servers");
|
||||
roptions = config_get_value(obj->parameters,
|
||||
"router_options");
|
||||
router = config_get_value(obj->parameters, "router");
|
||||
if (servers && obj->element)
|
||||
{
|
||||
char *s = strtok(servers, ",");
|
||||
@ -642,7 +647,7 @@ int error_count = 0;
|
||||
s = strtok(NULL, ",");
|
||||
}
|
||||
}
|
||||
else if (servers == NULL)
|
||||
else if (servers == NULL && internalService(router) == 0)
|
||||
{
|
||||
LOGIF(LE, (skygw_log_write_flush(
|
||||
LOGFILE_ERROR,
|
||||
@ -1703,3 +1708,29 @@ config_truth_value(char *str)
|
||||
return atoi(str);
|
||||
}
|
||||
|
||||
static char *InternalRouters[] = {
|
||||
"debugcli",
|
||||
"cli",
|
||||
NULL
|
||||
};
|
||||
|
||||
/**
|
||||
* Determine if the router is one of the special internal services that
|
||||
* MaxScale offers.
|
||||
*
|
||||
* @param router The router name
|
||||
* @return Non-zero if the router is in the InternalRouters table
|
||||
*/
|
||||
static int
|
||||
internalService(char *router)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (router)
|
||||
{
|
||||
for (i = 0; InternalRouters[i]; i++)
|
||||
if (strcmp(router, InternalRouters[i]) == 0)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user