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.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/resources/libraries/python/InterfaceUtil.py b/resources/libraries/python/InterfaceUtil.py
index 838ba3bb69..35077d8268 100644
--- a/resources/libraries/python/InterfaceUtil.py
+++ b/resources/libraries/python/InterfaceUtil.py
@@ -190,15 +190,15 @@ class InterfaceUtil(object):
if interface is not None:
if isinstance(interface, basestring):
- sw_if_index = Topology.get_interface_sw_index(node, interface)
+ param = "interface_name"
+ elif isinstance(interface, int):
+ param = "sw_if_index"
else:
- sw_if_index = interface
-
+ raise TypeError
for data_if in data:
- if data_if["sw_if_index"] == sw_if_index:
-
+ if data_if[param] == interface:
return data_if
-
+ return dict()
return data
@staticmethod