]> git.puffer.fish Git - matthieu/frr.git/commitdiff
yang: remove when condition from static nexthop om
authorChirag Shah <chirag@nvidia.com>
Wed, 13 Jan 2021 16:41:25 +0000 (08:41 -0800)
committerChirag Shah <chirag@nvidia.com>
Wed, 13 Jan 2021 17:24:25 +0000 (09:24 -0800)
Remove when conditions from the yang OM as it degrades
the performance in libyang.
Instead do the same when conditional check in frr northbound
validate phase. Reject the config if condiion do not meet.

Ticket:CM-32530
Testing Done:

Co-developed-by: VishalDhingra <vdhingra@vmware.com>
Signed-off-by: Chirag Shah <chirag@nvidia.com>
yang/frr-nexthop.yang

index 619514de7d4b2e50a8981f4c006fa7160dd20345..2df2e2958e92499b2be4af5c59ff5e855e53e993 100644 (file)
@@ -61,7 +61,7 @@ module frr-nexthop {
     type union {
       type inet:ip-address;
       type string {
-        pattern '';
+        pattern "";
       }
     }
   }
@@ -160,6 +160,7 @@ module frr-nexthop {
       description
         "The nexthop vrf name, if different from the route.";
     }
+
     leaf gateway {
       type frr-nexthop:optional-ip-address;
       description
@@ -173,15 +174,12 @@ module frr-nexthop {
     }
 
     leaf bh-type {
-      when "../nh-type = 'blackhole'";
       type blackhole-type;
       description
         "A blackhole sub-type, if the nexthop is a blackhole type.";
     }
 
     leaf onlink {
-      when "../nh-type = 'ip4-ifindex' or
-            ../nh-type = 'ip6-ifindex'";
       type boolean;
       default "false";
       description