vtysh: Cleanup some stuff(tm)

1) vtysh_config_dump was not properly indented.  Fix

2) Add VRF_NODE to be line_uniq when parsing return from sub-daemons

3) Fix 'no log monitor' to be line_uniq as well

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
Donald Sharp 2017-05-22 15:43:20 -04:00
parent 1da2945621
commit 9a7aa8be43

View File

@ -185,7 +185,8 @@ vtysh_config_parse_line (void *arg, const char *line)
else if (config->index == RMAP_NODE ||
config->index == INTERFACE_NODE ||
config->index == NS_NODE ||
config->index == VTY_NODE)
config->index == VTY_NODE ||
config->index == VRF_NODE)
config_add_line_uniq (config->line, line);
else
config_add_line (config->line, line);
@ -278,6 +279,7 @@ vtysh_config_parse_line (void *arg, const char *line)
|| strncmp (line, "hostname", strlen ("hostname")) == 0
|| strncmp (line, "frr", strlen ("frr")) == 0
|| strncmp (line, "agentx", strlen ("agentx")) == 0
|| strncmp (line, "no log", strlen ("no log")) == 0
)
config_add_line_uniq (config_top, line);
else
@ -324,7 +326,7 @@ vtysh_config_dump (FILE *fp)
/* Don't print empty sections for interface/vrf. Route maps on the
* other hand could have a legitimate empty section at the end.
*/
if ((config->index == INTERFACE_NODE || (config->index == VRF_NODE))
if ((config->index == INTERFACE_NODE || config->index == VRF_NODE)
&& list_isempty (config->line))
continue;