]> git.puffer.fish Git - matthieu/frr.git/commitdiff
mgmtd: rpc and action handling both should use rpc map.
authorChristian Hopps <chopps@labn.net>
Tue, 7 May 2024 02:37:52 +0000 (02:37 +0000)
committerChristian Hopps <chopps@labn.net>
Tue, 7 May 2024 03:34:41 +0000 (03:34 +0000)
The previous idea of using config xpath registrations for actions b/c
the config is the subject of the action is sub-optimal. It splits
handling of YANG "actions" (Action and RPCs) between 2 different
registartion maps for the same category of functionality.

Signed-off-by: Christian Hopps <chopps@labn.net>
mgmtd/mgmt_fe_adapter.c

index b20e36ce0cd413c1689b623c094f9f2078d175d7..fc1bde0b38ae80cc0ac90f853d65d02d86f7d391 100644 (file)
@@ -1443,20 +1443,14 @@ static void fe_adapter_handle_rpc(struct mgmt_fe_session_ctx *session,
                return;
        }
 
-       if (snode->nodetype == LYS_RPC)
-               clients =
-                       mgmt_be_interested_clients(xpath,
-                                                  MGMT_BE_XPATH_SUBSCR_TYPE_RPC);
-       else if (snode->nodetype == LYS_ACTION)
-               clients =
-                       mgmt_be_interested_clients(xpath,
-                                                  MGMT_BE_XPATH_SUBSCR_TYPE_CFG);
-       else {
+       if (snode->nodetype != LYS_RPC && snode->nodetype != LYS_ACTION) {
                fe_adapter_send_error(session, req_id, false, -EINVAL,
                                      "Not an RPC or action path: %s", xpath);
                return;
        }
 
+       clients = mgmt_be_interested_clients(xpath,
+                                            MGMT_BE_XPATH_SUBSCR_TYPE_RPC);
        if (!clients) {
                __dbg("No backends implement xpath: %s for txn-id: %" PRIu64
                      " session-id: %" PRIu64,