]> git.puffer.fish Git - mirror/frr.git/commitdiff
build: remove mgmtd exception from xref2vtysh
authorIgor Ryzhov <iryzhov@nfware.com>
Sat, 27 Jan 2024 04:20:22 +0000 (06:20 +0200)
committerIgor Ryzhov <iryzhov@nfware.com>
Sun, 28 Jan 2024 21:28:40 +0000 (23:28 +0200)
We may actually need to send CLI commands to mgmtd and another daemon at
the same time, for example, if this daemon is not mgmtd-converted. The
only daemon this exception protects is staticd. But we don't actually
need any configuration commands in staticd, so just remove the exception
and don't install unnecessary commands to staticd.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
python/xref2vtysh.py
staticd/static_vty.c

index 1760588ca84e290203b613b214645ed0c0a5d64d..91ccba64f0d07dbb2c5efc6c7a8faae5714fc487 100644 (file)
@@ -324,17 +324,7 @@ class CommandEntry:
     def load(cls, xref):
         nodes = NodeDict()
 
-        mgmtname = "mgmtd/libmgmt_be_nb.la"
         for cmd_name, origins in xref.get("cli", {}).items():
-            # If mgmtd has a yang version of a CLI command, make it the only daemon
-            # to handle it.  For now, daemons can still be compiling their cmds into the
-            # binaries to allow for running standalone with CLI config files. When they
-            # do this they will also be present in the xref file, but we want to ignore
-            # those in vtysh.
-            if "yang" in origins.get(mgmtname, {}).get("attrs", []):
-                CommandEntry.process(nodes, cmd_name, mgmtname, origins[mgmtname])
-                continue
-
             for origin, spec in origins.items():
                 CommandEntry.process(nodes, cmd_name, origin, spec)
         return nodes
index 95f79564af9e9e58093a8a6b2b189e013dbc112b..05f23f54d1c93a918540fb4c9c8396c9ea04c3fa 100644 (file)
@@ -1696,8 +1696,7 @@ void static_vty_init(void)
        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 */
-
+#else /* else INCLUDE_MGMTD_CMDDEFS_ONLY */
        install_element(CONFIG_NODE, &ip_mroute_dist_cmd);
 
        install_element(CONFIG_NODE, &ip_route_blackhole_cmd);
@@ -1713,6 +1712,7 @@ void static_vty_init(void)
        install_element(VRF_NODE, &ipv6_route_address_interface_vrf_cmd);
        install_element(CONFIG_NODE, &ipv6_route_cmd);
        install_element(VRF_NODE, &ipv6_route_vrf_cmd);
+#endif /* ifndef INCLUDE_MGMTD_CMDDEFS_ONLY */
 
 #ifndef INCLUDE_MGMTD_CMDDEFS_ONLY
        mgmt_be_client_lib_vty_init();