aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/InterfaceUtil.py
diff options
context:
space:
mode:
Diffstat (limited to 'resources/libraries/python/InterfaceUtil.py')
-rw-r--r--resources/libraries/python/InterfaceUtil.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 793f908a7a..ff9ecdede5 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -261,8 +261,14 @@ class InterfaceUtil(object):
:rtype: list
"""
- sw_if_index = Topology.convert_interface_reference(
- node, interface, "sw_if_index")
+ try:
+ sw_if_index = Topology.convert_interface_reference(
+ node, interface, "sw_if_index")
+ except RuntimeError:
+ if isinstance(interface, basestring):
+ sw_if_index = InterfaceUtil.get_sw_if_index(node, interface)
+ else:
+ raise
with VatTerminal(node) as vat:
response = vat.vat_terminal_exec_cmd_from_template(