From: Ondrej Lichtner <olichtne(a)redhat.com>
If the Device was deleted the _update_netlink method should raise an
Exception. This was probably forgotten previously...
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Devices/Device.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lnst/Devices/Device.py b/lnst/Devices/Device.py
index 3782c95..80abdcf 100644
--- a/lnst/Devices/Device.py
+++ b/lnst/Devices/Device.py
@@ -182,6 +182,9 @@ class Device(object):
self._nl_msg = nl_msg
def _update_netlink(self, nl_msg):
+ if getattr(self, "_deleted"):
+ raise DeviceDeleted("Device was deleted.")
+
if self.ifindex != nl_msg['index']:
msg = "ifindex of netlink message (%s) doesn't match "\
"the device's (%s)." % (nl_msg['index'],
self.ifindex)
--
2.17.0