[PATCH] python: fixup VLANLink() initialization

Nicolas PLANEL nicolas.planel at enovance.com
Tue Oct 1 15:58:36 EDT 2013


   Hi,

Here a trivial fixup of VLANLink class initialization.

Regards,

Nicolas PLANEL

---
     python: fixup VLANLink() initialization

     The varialble name should be link._rtnl_link
     instead of link._link to get rid of the AttributeError.

     Traceback (most recent call last):
       File "examples/test.py", line 11, in <module>
         eth0 = link.resolve('eth0.800')
       ...
       File 
"/home/ubuntu/libnl/python/build/lib.linux-x86_64-2.7/netlink/route/link.py", 
line 151, in __init__
         self._module_lookup('netlink.route.links.' + self.type)
       ...
       File 
"/home/ubuntu/libnl/python/build/lib.linux-x86_64-2.7/netlink/route/links/vlan.py", 
line 70, in init
         link.vlan = VLANLink(link._link)
     AttributeError: 'Link' object has no attribute '_link'

     Signed-off-by: Nicolas PLANEL <nicolas.planel at enovance.com>

diff --git a/python/netlink/route/links/vlan.py 
b/python/netlink/route/links/vlan.py
index 70045d5..0ba3781 100644
--- a/python/netlink/route/links/vlan.py
+++ b/python/netlink/route/links/vlan.py
@@ -67,5 +67,5 @@ class VLANLink(object):
          return 'vlan-id {0}'.format(self.id)

  def init(link):
-    link.vlan = VLANLink(link._link)
+    link.vlan = VLANLink(link._rtnl_link)
      return link.vlan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-python-fixup-VLANLink-initialization.patch
Type: text/x-patch
Size: 1397 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20131001/34dc6bc8/attachment.bin>


More information about the libnl mailing list