Skip to content

Commit

Permalink
[show interface neighbor expected] Support 'alias' interface naming m…
Browse files Browse the repository at this point in the history
…ode (#495)
  • Loading branch information
tsvanduyn authored and jleveque committed Apr 3, 2019
1 parent aae39e7 commit 65f69e4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions show/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,6 +450,10 @@ def expected(interfacename):
#Swap Key and Value from interface: name to name: interface
device2interface_dict = {}
for port in natsorted(neighbor_dict.keys()):
temp_port = port
if get_interface_mode() == "alias":
port = iface_alias_converter.name_to_alias(port)
neighbor_dict[port] = neighbor_dict.pop(temp_port)
device2interface_dict[neighbor_dict[port]['name']] = {'localPort': port, 'neighborPort': neighbor_dict[port]['port']}

header = ['LocalPort', 'Neighbor', 'NeighborPort', 'NeighborLoopback', 'NeighborMgmt', 'NeighborType']
Expand Down

0 comments on commit 65f69e4

Please sign in to comment.