daemon: updates to support configuring and tracking mtu, along with over refactoring

This commit is contained in:
Blake Harnden 2022-01-07 16:03:45 -08:00
parent 0b531d7fd8
commit 871b1ae2af
7 changed files with 93 additions and 151 deletions

View file

@ -95,14 +95,14 @@ class LinuxNetClient:
"""
return self.run(f"cat /sys/class/net/{device}/address")
def get_ifindex(self, device: str) -> str:
def get_ifindex(self, device: str) -> int:
"""
Retrieve ifindex for a given device.
:param device: device to get ifindex for
:return: ifindex
"""
return self.run(f"cat /sys/class/net/{device}/ifindex")
return int(self.run(f"cat /sys/class/net/{device}/ifindex"))
def device_ns(self, device: str, namespace: str) -> None:
"""