From: Ondrej Lichtner <olichtne(a)redhat.com>
The index of the parent device is accessible through the IFLA_LINK
attribute only for vlan devices, for other device types (vxlan or vti)
the index is accessible through IFLA_INFO_DATA.
Having a correct reference for the parent device is required for correct
ordering of deconfiguration commands.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Ondrej, I've tried syncing to the 'master' branch but now my tests are
failing
with the following:
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/lnst/Slave/NetTestSlave.py", line
1432, in _process_msg
result = method(*msg["args"])
File "/usr/lib/python2.7/site-packages/lnst/Slave/NetTestSlave.py", line
82, in hello
self._if_manager.rescan_devices()
File "/usr/lib/python2.7/site-packages/lnst/Slave/InterfaceManager.py",
line 116, in rescan_devices
self._devices[dev['index']].update_netlink(dev['netlink_msg'])
File "/usr/lib/python2.7/site-packages/lnst/Slave/InterfaceManager.py",
line 415, in update_netlink
if nl_msg.get_nested("IFLA_LINKINFO", "IFLA_INFO_KIND") ==
"vxlan":
AttributeError: 'ifinfmsg' object has no attribute 'get_nested'
What's missing?
---
lnst/Slave/InterfaceManager.py | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/lnst/Slave/InterfaceManager.py b/lnst/Slave/InterfaceManager.py
index 5c646b4..b7c15d3 100644
--- a/lnst/Slave/InterfaceManager.py
+++ b/lnst/Slave/InterfaceManager.py
@@ -407,7 +407,15 @@ class Device(object):
self.set_master(nl_msg.get_attr("IFLA_MASTER"), primary=True)
self._mtu = nl_msg.get_attr("IFLA_MTU")
- link = nl_msg.get_attr("IFLA_LINK")
+ if nl_msg.get_nested("IFLA_LINKINFO", "IFLA_INFO_KIND")
==
"vxlan":
+ link = nl_msg.get_nested("IFLA_LINKINFO",
"IFLA_INFO_DATA",
+ "IFLA_VXLAN_LINK")
+ elif nl_msg.get_nested("IFLA_LINKINFO",
"IFLA_INFO_KIND") == "vti":
+ link = nl_msg.get_nested("IFLA_LINKINFO",
"IFLA_INFO_DATA",
+ "IFLA_VTI_LINK")
+ else:
+ link = nl_msg.get_attr("IFLA_LINK")
+
if link != None:
# IFLA_LINK is an index of device that's closer to physical
# interface in the stack, e.g. index of eth0 for eth0.100
--
2.16.1
_______________________________________________
LNST-developers mailing list -- lnst-developers(a)lists.fedorahosted.org
To unsubscribe send an email to lnst-developers-leave(a)lists.fedorahosted.org