From 6be1e19d982ca87bee234e15ae159447d61013d5 Mon Sep 17 00:00:00 2001 From: Jeff Ahrenholz Date: Thu, 31 Oct 2019 13:20:28 -0700 Subject: [PATCH] don't flush IPv6 address if interface is absent --- daemon/core/nodes/netclient.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/core/nodes/netclient.py b/daemon/core/nodes/netclient.py index b201493f..7a9cc2d8 100644 --- a/daemon/core/nodes/netclient.py +++ b/daemon/core/nodes/netclient.py @@ -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): """