-
-
Notifications
You must be signed in to change notification settings - Fork 247
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom ifinfmsg plugin stopped working with version 0.6 #886
Comments
Got it, working on the issue. |
1. to define a custom link kind "foo":: # file: .../my_package/foo.py from pyroute2.netlink import nla class foo(nla): prefix = 'IFLA_' nla_map = ( ('IFLA_FOO_UNSPEC', 'none), ('IFLA_FOO_PARAM', 'uint16'), ) # your code import my_package from my_package.foo import foo ipr = IPRoute() ipr.register_link_kind(path='.../my_package/') ipr.register_link_kind(package=my_package) ipr.register_link_kind(module={'foo': foo}) Bug-Url: #886
@MJDickensheets pls review the commit: 7dd1d55 it is also possible to override existing kinds like to make your own bridge, bond etc. implementation |
Looks like there may be a left-over print statement, but otherwise I think this will do very nicely for our purposes. Thank you for the quick work! |
Please reopen the ticket if there will be issues with the functionality, I'm to fix it asap. |
I have tested the fix/feature from my end, everything appears to be working as expected. Would it be possible to schedule a tagged release in the near term? |
0.6.8 is to be tagged on Saturday. |
We have been using a custom plugin module and adding it to the ifinfmsg handler via the following procedure:
An interface with our custom type can then be added:
As of version 0.6, the
link("add")
results inpr2modules.netlink.exceptions.NetlinkError: (22, 'Invalid argument')
. Some investigation revealed that theifinfmsg
instance visible to theIPRoute
object did not have itsifinfo.data_map
updated as we would have expected.As a side note, it would also be nice to have a proper API with which to load plugins, particularly dynamically and not just at import time.
The text was updated successfully, but these errors were encountered: