fix(Core): Interface not recognized 59/33859/3
authorpmikus <pmikus@cisco.com>
Tue, 28 Sep 2021 07:46:41 +0000 (07:46 +0000)
committerPeter Mikus <pmikus@cisco.com>
Tue, 28 Sep 2021 16:44:57 +0000 (16:44 +0000)
+ Make better error message.

Signed-off-by: pmikus <pmikus@cisco.com>
Change-Id: I2dbb9a50215bd6665c5c278653edd9324314e6b8

resources/libraries/python/InterfaceUtil.py

index ebbd4f2..7e474ab 100644 (file)
@@ -212,6 +212,10 @@ class InterfaceUtil:
             raise ValueError(f"Unknown if_type: {if_type}")
 
         if node[u"type"] == NodeType.DUT:
+            if sw_if_index is None:
+                raise ValueError(
+                    f"Interface index for {interface} not assigned by VPP."
+                )
             if state == u"up":
                 flags = InterfaceStatusFlags.IF_STATUS_API_FLAG_ADMIN_UP.value
             elif state == u"down":