Skip to content

Commit 76d996b

Browse files
committed
Fix the issue #4 of failed parsing of network interfaces
Signed-off-by: Chengyu Liu <chengyu_l@126.com>
1 parent 18ef355 commit 76d996b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

ece_os_readiness/mor.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ def get_ip_of_ifname(netif_name: str) -> str:
338338
return ''
339339

340340
errcnt = 0
341+
netif_name = netif_name.split('@')[0]
341342
cmd = f"ip addr show {netif_name}"
342343
try:
343344
out, err, rc = runcmd(cmd)
@@ -4707,6 +4708,7 @@ def get_speed_of_network_interface(netif: str) -> int:
47074708
if not netif or isinstance(netif, str) is False:
47084709
print(f"{ERROR} Invalid parameter netif: {netif}")
47094710
return -1
4711+
netif = netif.split('@')[0]
47104712
speed_file = f"/sys/class/net/{netif}/speed"
47114713
speed = -1
47124714
try:

0 commit comments

Comments
 (0)