Commit 98cdebb 1 parent 5f1de81 commit 98cdebb Copy full SHA for 98cdebb
File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ def name_to_alias(self, interface_name):
79
79
if interface_name == port_name :
80
80
return self .port_dict [port_name ]['alias' ]
81
81
82
- click . echo ( "Invalid interface {}" . format ( interface_name ))
83
- raise click . Abort ()
82
+ # interface_name not in port_dict. Just return interface_name
83
+ return interface_name
84
84
85
85
def alias_to_name (self , interface_alias ):
86
86
"""Return SONiC interface name if vendor
@@ -91,8 +91,8 @@ def alias_to_name(self, interface_alias):
91
91
if interface_alias == self .port_dict [port_name ]['alias' ]:
92
92
return port_name
93
93
94
- click . echo ( "Invalid interface {}" . format ( interface_alias ))
95
- raise click . Abort ()
94
+ # interface_alias not in port_dict. Just return interface_alias
95
+ return interface_alias
96
96
97
97
98
98
# Global Config object
@@ -902,7 +902,12 @@ def interfaces():
902
902
oper = get_if_oper_state (iface )
903
903
else :
904
904
oper = "down"
905
+
906
+ if get_interface_mode () == "alias" :
907
+ iface = iface_alias_converter .name_to_alias (iface )
908
+
905
909
data .append ([iface , ifaddresses [0 ][1 ], admin + "/" + oper ])
910
+
906
911
for ifaddr in ifaddresses [1 :]:
907
912
data .append (["" , ifaddr [1 ], "" ])
908
913
You can’t perform that action at this time.
0 commit comments