From 25fe5b0fe86ae5d07671ebbfea38750f29b6ca6a Mon Sep 17 00:00:00 2001 From: Igor Ryzhov Date: Mon, 26 Apr 2021 16:48:11 +0300 Subject: [PATCH] isisd: remove useless checks from cli is-type defaults to level-1-2 for more than a year already. Signed-off-by: Igor Ryzhov --- isisd/isis_cli.c | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/isisd/isis_cli.c b/isisd/isis_cli.c index b108210686..27d2492bcf 100644 --- a/isisd/isis_cli.c +++ b/isisd/isis_cli.c @@ -62,19 +62,7 @@ DEFPY_YANG_NOSH(router_isis, router_isis_cmd, "/frr-isisd:isis/instance[area-tag='%s'][vrf='%s']", tag, vrf_name); nb_cli_enqueue_change(vty, ".", NB_OP_CREATE, NULL); - /* default value in yang for is-type is level-1, but in FRR - * the first instance is assigned is-type level-1-2. We - * need to make sure to set it in the yang model so that it - * is consistent with what FRR sees. - */ - if (!im) { - return CMD_SUCCESS; - } - - if (listcount(im->isis) == 0) - nb_cli_enqueue_change(vty, "./is-type", NB_OP_MODIFY, - "level-1-2"); ret = nb_cli_apply_changes(vty, base_xpath); if (ret == CMD_SUCCESS) VTY_PUSH_XPATH(ISIS_NODE, base_xpath); @@ -190,13 +178,6 @@ DEFPY_YANG(ip_router_isis, ip_router_isis_cmd, "/frr-isisd:isis/instance[area-tag='%s'][vrf='%s']", tag, vrf_name); nb_cli_enqueue_change(vty, temp_xpath, NB_OP_CREATE, tag); - snprintf( - temp_xpath, XPATH_MAXLEN, - "/frr-isisd:isis/instance[area-tag='%s'][vrf='%s']/is-type", - tag, vrf_name); - nb_cli_enqueue_change(vty, temp_xpath, NB_OP_MODIFY, - listcount(im->isis) == 0 ? "level-1-2" - : NULL); nb_cli_enqueue_change(vty, "./frr-isisd:isis", NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, "./frr-isisd:isis/area-tag", @@ -206,9 +187,6 @@ DEFPY_YANG(ip_router_isis, ip_router_isis_cmd, vrf_name); nb_cli_enqueue_change(vty, "./frr-isisd:isis/ipv4-routing", NB_OP_MODIFY, "true"); - nb_cli_enqueue_change( - vty, "./frr-isisd:isis/circuit-type", NB_OP_MODIFY, - listcount(im->isis) == 0 ? "level-1-2" : "level-1"); } else { /* area exists, circuit type defaults to its area's is_type */ switch (area->is_type) { @@ -287,13 +265,6 @@ DEFPY_YANG(ip6_router_isis, ip6_router_isis_cmd, "/frr-isisd:isis/instance[area-tag='%s'][vrf='%s']", tag, vrf_name); nb_cli_enqueue_change(vty, temp_xpath, NB_OP_CREATE, tag); - snprintf( - temp_xpath, XPATH_MAXLEN, - "/frr-isisd:isis/instance[area-tag='%s'][vrf='%s']/is-type", - tag, vrf_name); - nb_cli_enqueue_change(vty, temp_xpath, NB_OP_MODIFY, - listcount(im->isis) == 0 ? "level-1-2" - : NULL); nb_cli_enqueue_change(vty, "./frr-isisd:isis", NB_OP_CREATE, NULL); nb_cli_enqueue_change(vty, "./frr-isisd:isis/area-tag", @@ -303,9 +274,6 @@ DEFPY_YANG(ip6_router_isis, ip6_router_isis_cmd, nb_cli_enqueue_change(vty, "./frr-isisd:isis/ipv6-routing", NB_OP_MODIFY, "true"); - nb_cli_enqueue_change( - vty, "./frr-isisd:isis/circuit-type", NB_OP_MODIFY, - listcount(im->isis) == 0 ? "level-1-2" : "level-1"); } else { /* area exists, circuit type defaults to its area's is_type */ switch (area->is_type) {