Skip to content

Commit

Permalink
Merge pull request #14822 from FRRouting/mergify/bp/stable/9.1/pr-14814
Browse files Browse the repository at this point in the history
staticd: fix debug commands (backport #14814)
  • Loading branch information
donaldsharp authored Nov 20, 2023
2 parents 2b7dbe6 + dffc65e commit 5f46d4a
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions staticd/static_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -1573,25 +1573,24 @@ int static_path_list_cli_cmp(const struct lyd_node *dnode1,
return (int)distance1 - (int)distance2;
}

#ifndef INCLUDE_MGMTD_CMDDEFS_ONLY

DEFPY_YANG(debug_staticd, debug_staticd_cmd,
"[no] debug static [{events$events|route$route|bfd$bfd}]",
NO_STR DEBUG_STR STATICD_STR
"Debug events\n"
"Debug route\n"
"Debug bfd\n")
{
#ifndef INCLUDE_MGMTD_CMDDEFS_ONLY
/* If no specific category, change all */
if (strmatch(argv[argc - 1]->text, "static"))
static_debug_set(vty->node, !no, true, true, true);
else
static_debug_set(vty->node, !no, !!events, !!route, !!bfd);
#endif /* ifndef INCLUDE_MGMTD_CMDDEFS_ONLY */

return CMD_SUCCESS;
}

#ifndef INCLUDE_MGMTD_CMDDEFS_ONLY
DEFPY(staticd_show_bfd_routes, staticd_show_bfd_routes_cmd,
"show bfd static route [json]$isjson",
SHOW_STR
Expand Down Expand Up @@ -1633,6 +1632,8 @@ void static_vty_init(void)
{
#ifndef INCLUDE_MGMTD_CMDDEFS_ONLY
install_node(&debug_node);
install_element(ENABLE_NODE, &debug_staticd_cmd);
install_element(CONFIG_NODE, &debug_staticd_cmd);
install_element(ENABLE_NODE, &show_debugging_static_cmd);
install_element(ENABLE_NODE, &staticd_show_bfd_routes_cmd);
#endif /* ifndef INCLUDE_MGMTD_CMDDEFS_ONLY */
Expand All @@ -1653,8 +1654,5 @@ void static_vty_init(void)
install_element(CONFIG_NODE, &ipv6_route_cmd);
install_element(VRF_NODE, &ipv6_route_vrf_cmd);

install_element(ENABLE_NODE, &debug_staticd_cmd);
install_element(CONFIG_NODE, &debug_staticd_cmd);

mgmt_be_client_lib_vty_init();
}

0 comments on commit 5f46d4a

Please sign in to comment.