changes to make rj45 maintain the interface information, instead of trying to be 2 classes at once
This commit is contained in:
parent
8fed201fd8
commit
7e4ef0b280
5 changed files with 47 additions and 74 deletions
|
@ -71,13 +71,22 @@ class LinuxNetClient:
|
|||
|
||||
def device_show(self, device: str) -> str:
|
||||
"""
|
||||
Show information for a device.
|
||||
Show link information for a device.
|
||||
|
||||
:param device: device to get information for
|
||||
:return: device information
|
||||
"""
|
||||
return self.run(f"{IP_BIN} link show {device}")
|
||||
|
||||
def address_show(self, device: str) -> str:
|
||||
"""
|
||||
Show address information for a device.
|
||||
|
||||
:param device: device name
|
||||
:return: address information
|
||||
"""
|
||||
return self.run(f"{IP_BIN} address show {device}")
|
||||
|
||||
def get_mac(self, device: str) -> str:
|
||||
"""
|
||||
Retrieve MAC address for a given device.
|
||||
|
@ -114,7 +123,8 @@ class LinuxNetClient:
|
|||
:return: nothing
|
||||
"""
|
||||
self.run(
|
||||
f"[ -e /sys/class/net/{device} ] && {IP_BIN} -6 address flush dev {device} || true",
|
||||
f"[ -e /sys/class/net/{device} ] && "
|
||||
f"{IP_BIN} address flush dev {device} || true",
|
||||
shell=True,
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue