summaryrefslogtreecommitdiff
path: root/staticd
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2023-11-17 02:27:55 +0100
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-11-17 12:27:26 +0000
commitdffc65ef69a9e18a64ff38487aad044a2df30e33 (patch)
tree57255960f37f6c3e06fa55202076d4a2102ad72d /staticd
parent2b7dbe69c3fc4173b25cae67a1e042f3d7945196 (diff)
staticd: fix debug commands
Debug commands should be installed in staticd, not in mgmtd. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com> (cherry picked from commit 649f04d679658b35ebfec5474988543c108af3c5)
Diffstat (limited to 'staticd')
-rw-r--r--staticd/static_vty.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/staticd/static_vty.c b/staticd/static_vty.c
index 0582df88ab..e94acba231 100644
--- a/staticd/static_vty.c
+++ b/staticd/static_vty.c
@@ -1573,6 +1573,8 @@ 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
@@ -1580,18 +1582,15 @@ DEFPY_YANG(debug_staticd, debug_staticd_cmd,
"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
@@ -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 */
@@ -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();
}