From: Christos Sfakianakis <csfakian(a)redhat.com>
Remove code which is never executed from _update_netlink()
method.
Signed-off-by: Christos Sfakianakis <csfakian(a)redhat.com>
---
lnst/Devices/Device.py | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/lnst/Devices/Device.py b/lnst/Devices/Device.py
index 9587a88..3037f45 100644
--- a/lnst/Devices/Device.py
+++ b/lnst/Devices/Device.py
@@ -191,26 +191,14 @@ class Device(object):
raise DeviceError(msg)
if nl_msg['header']['type'] == RTM_NEWLINK:
- if self.ifindex != nl_msg['index']:
- raise DeviceError("RTM_NEWLINK message passed to incorrect "\
- "Device object.")
-
self._nl_msg = nl_msg
elif nl_msg['header']['type'] == RTM_NEWADDR:
- if self.ifindex != nl_msg['index']:
- raise DeviceError("RTM_NEWADDR message passed to incorrect "\
- "Device object.")
-
addr = ipaddress(nl_msg.get_attr('IFA_ADDRESS'))
addr.prefixlen = nl_msg["prefixlen"]
if addr not in self._ip_addrs:
self._ip_addrs.append(addr)
elif nl_msg['header']['type'] == RTM_DELADDR:
- if self.ifindex != nl_msg['index']:
- raise DeviceError("RTM_DELADDR message passed to incorrect "\
- "Device object.")
-
addr = ipaddress(nl_msg.get_attr('IFA_ADDRESS'))
addr.prefixlen = nl_msg["prefixlen"]
--
2.17.1