don't flush IPv6 address if interface is absent

This commit is contained in:
Jeff Ahrenholz 2019-10-31 13:20:28 -07:00
parent 19300c7564
commit 6be1e19d98

View file

@ -126,7 +126,7 @@ class LinuxNetClient:
:param str device: device to flush
:return: nothing
"""
self.run(f"{IP_BIN} -6 address flush dev {device}")
self.run(f"[ -e /sys/class/net/{device} ] && {IP_BIN} -6 address flush dev {device} || echo")
def device_mac(self, device, mac):
"""