Revert "bgpd: convert send-community to transactional cli"

This reverts commit e48a9a90e0.
This commit is contained in:
Igor Ryzhov 2021-05-14 01:40:02 +03:00
parent 4fd9919ecf
commit f63d4054d1

View File

@ -6338,28 +6338,10 @@ DEFUN_YANG (neighbor_send_community,
"Send Community attribute to this neighbor\n") "Send Community attribute to this neighbor\n")
{ {
int idx_peer = 1; int idx_peer = 1;
char *peer_str = argv[idx_peer]->arg;
char base_xpath[XPATH_MAXLEN];
char af_xpath[XPATH_MAXLEN];
char std_xpath[XPATH_MAXLEN];
afi_t afi = bgp_node_afi(vty);
safi_t safi = bgp_node_safi(vty);
snprintf(af_xpath, sizeof(af_xpath), FRR_BGP_AF_XPATH, return peer_af_flag_set_vty(vty, argv[idx_peer]->arg, bgp_node_afi(vty),
yang_afi_safi_value2identity(afi, safi)); bgp_node_safi(vty),
PEER_FLAG_SEND_COMMUNITY);
if (peer_and_group_lookup_nb(vty, peer_str, base_xpath,
sizeof(base_xpath), af_xpath)
< 0)
return CMD_WARNING_CONFIG_FAILED;
snprintf(std_xpath, sizeof(std_xpath),
"./%s/send-community/send-community",
bgp_afi_safi_get_container_str(afi, safi));
nb_cli_enqueue_change(vty, std_xpath, NB_OP_MODIFY, "true");
return nb_cli_apply_changes(vty, base_xpath);
} }
ALIAS_HIDDEN(neighbor_send_community, neighbor_send_community_hidden_cmd, ALIAS_HIDDEN(neighbor_send_community, neighbor_send_community_hidden_cmd,
@ -6376,28 +6358,10 @@ DEFUN_YANG (no_neighbor_send_community,
"Send Community attribute to this neighbor\n") "Send Community attribute to this neighbor\n")
{ {
int idx_peer = 2; int idx_peer = 2;
char *peer_str = argv[idx_peer]->arg;
char base_xpath[XPATH_MAXLEN];
char af_xpath[XPATH_MAXLEN];
char std_xpath[XPATH_MAXLEN];
afi_t afi = bgp_node_afi(vty);
safi_t safi = bgp_node_safi(vty);
snprintf(af_xpath, sizeof(af_xpath), FRR_BGP_AF_XPATH, return peer_af_flag_unset_vty(vty, argv[idx_peer]->arg,
yang_afi_safi_value2identity(afi, safi)); bgp_node_afi(vty), bgp_node_safi(vty),
PEER_FLAG_SEND_COMMUNITY);
if (peer_and_group_lookup_nb(vty, peer_str, base_xpath,
sizeof(base_xpath), af_xpath)
< 0)
return CMD_WARNING_CONFIG_FAILED;
snprintf(std_xpath, sizeof(std_xpath),
"./%s/send-community/send-community",
bgp_afi_safi_get_container_str(afi, safi));
nb_cli_enqueue_change(vty, std_xpath, NB_OP_MODIFY, "false");
return nb_cli_apply_changes(vty, base_xpath);
} }
ALIAS_HIDDEN(no_neighbor_send_community, no_neighbor_send_community_hidden_cmd, ALIAS_HIDDEN(no_neighbor_send_community, no_neighbor_send_community_hidden_cmd,