Update network.py

This commit is contained in:
alesapin 2021-08-27 20:39:05 +03:00 committed by GitHub
parent de96bd1be9
commit cd389f12f6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -242,7 +242,7 @@ class _NetworkManager:
class NetThroughput(object):
def __init__(self, node):
try:
self.interface = subprocess.check_output("awk '{ print $1 " " $2}' /proc/net/route | head -n 2 | tail -n 1 | awk '{print $1}'", shell=True).strip().decode("utf-8")
self.interface = subprocess.check_output("awk '{print $1}' /proc/net/route | head -n 2 | tail -n 1", shell=True).strip().decode("utf-8")
except Exception as ex:
raise Exception("Cannot get default network interface" + str(ex)) from ex