From 98f224ef22bc9ec22b8be51756ae12e7740cbd5a Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Fri, 16 Jun 2017 22:43:09 +0000 Subject: [PATCH] lib: improve routemap error messages indicate which daemon was the source of the message and that it may be a question of daemon support rather than a malformed argument Signed-off-by: Quentin Young --- lib/routemap.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/lib/routemap.c b/lib/routemap.c index fcd3c7a7aa..17f25334a7 100644 --- a/lib/routemap.c +++ b/lib/routemap.c @@ -521,10 +521,12 @@ generic_match_add (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE); + vty_out (vty, "%% [%s] Can't find rule.%s", frr_protonameinst, + VTY_NEWLINE); return CMD_WARNING; case RMAP_COMPILE_ERROR: - vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE); + vty_out (vty, "%% [%s] Argument form is unsupported or malformed.%s", + frr_protonameinst, VTY_NEWLINE); return CMD_WARNING; } } @@ -567,10 +569,12 @@ generic_match_delete (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_out (vty, "%% BGP Can't find rule.%s", VTY_NEWLINE); + vty_out (vty, "%% [%s] Can't find rule.%s", frr_protonameinst, + VTY_NEWLINE); break; case RMAP_COMPILE_ERROR: - vty_out (vty, "%% BGP Argument is malformed.%s", VTY_NEWLINE); + vty_out (vty, "%% [%s] Argument form is unsupported or malformed.%s", + frr_protonameinst, VTY_NEWLINE); break; } if (dep_name) @@ -603,10 +607,12 @@ generic_set_add (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE); + vty_out (vty, "%% [%s] Can't find rule.%s", frr_protonameinst, + VTY_NEWLINE); return CMD_WARNING; case RMAP_COMPILE_ERROR: - vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE); + vty_out (vty, "%% [%s] Argument form is unsupported or malformed.%s", + frr_protonameinst, VTY_NEWLINE); return CMD_WARNING; } } @@ -625,10 +631,12 @@ generic_set_delete (struct vty *vty, struct route_map_index *index, switch (ret) { case RMAP_RULE_MISSING: - vty_out (vty, "%% Can't find rule.%s", VTY_NEWLINE); + vty_out (vty, "%% [%s] Can't find rule.%s", frr_protonameinst, + VTY_NEWLINE); return CMD_WARNING; case RMAP_COMPILE_ERROR: - vty_out (vty, "%% Argument is malformed.%s", VTY_NEWLINE); + vty_out (vty, "%% [%s] Argument form is unsupported or malformed.%s", + frr_protonameinst, VTY_NEWLINE); return CMD_WARNING; } } -- 2.39.5