Skip to content

Commit b31681b

Browse files
Fix display disorder problem of show vrf (sonic-net#2392)
*Fix display disorder problem of show vrf
1 parent 123504a commit b31681b

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

show/main.py

+1
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ def vrf(vrf_name):
325325
vrfs = [vrf_name]
326326
for vrf in vrfs:
327327
intfs = get_interface_bind_to_vrf(config_db, vrf)
328+
intfs = natsorted(intfs)
328329
if len(intfs) == 0:
329330
body.append([vrf, ""])
330331
else:

tests/show_vrf_test.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ def test_vrf_show(self):
2727
------ ---------------
2828
Vrf1
2929
Vrf101 Ethernet0.10
30-
Vrf102 PortChannel0002
30+
Vrf102 Eth36.10
31+
PortChannel0002
3132
Vlan40
32-
Eth36.10
3333
Vrf103 Ethernet4
3434
Loopback0
3535
Po0002.101
@@ -51,9 +51,9 @@ def test_vrf_bind_unbind(self):
5151
------ ---------------
5252
Vrf1
5353
Vrf101 Ethernet0.10
54-
Vrf102 PortChannel0002
54+
Vrf102 Eth36.10
55+
PortChannel0002
5556
Vlan40
56-
Eth36.10
5757
Vrf103 Ethernet4
5858
Loopback0
5959
Po0002.101
@@ -112,9 +112,9 @@ def test_vrf_bind_unbind(self):
112112
------ ---------------
113113
Vrf1
114114
Vrf101 Ethernet0.10
115-
Vrf102 PortChannel0002
115+
Vrf102 Eth36.10
116+
PortChannel0002
116117
Vlan40
117-
Eth36.10
118118
Vrf103 Ethernet4
119119
Loopback0
120120
Po0002.101

0 commit comments

Comments
 (0)