I missed this patch last week when sending the patch series. Without
this running lnst-slave will fail with a KeyError exception.
I apologise for causing any problems...
-Ondrej
On Mon, Feb 10, 2014 at 12:13:42PM +0100, olichtne(a)redhat.com wrote:
From: Ondrej Lichtner <olichtne(a)redhat.com>
The list returned by the scan_netdevs function will now also contain the
netlink message describing the device this will be used later when
creating the slave local device database.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Common/NetUtils.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/lnst/Common/NetUtils.py b/lnst/Common/NetUtils.py
index b649483..79d2de7 100644
--- a/lnst/Common/NetUtils.py
+++ b/lnst/Common/NetUtils.py
@@ -52,12 +52,13 @@ def scan_netdevs():
if part["header"]["type"] == RTM_NEWLINK:
new_link = {}
- for name, value in part["attrs"]:
- if name == "IFLA_IFNAME":
- new_link["name"] = value
- elif name == "IFLA_ADDRESS":
- new_link["hwaddr"] = normalize_hwaddr(value)
+ new_link["netlink_msg"] = part
new_link["index"] = part["index"]
+ new_link["name"] = part.get_attr("IFLA_IFNAME")
+
+ hwaddr = part.get_attr("IFLA_ADDRESS")
+ new_link["hwaddr"] = normalize_hwaddr(hwaddr)
+
scan.append(new_link)
nl_socket.close()
--
1.8.5.3