Closed
Description
We have been using a custom plugin module and adding it to the ifinfmsg handler via the following procedure:
from pyroute2.netlink.rtnl import ifinfmsg
ifinfmsg.ifinfbase.ifinfo.data_map.update(
ifinfmsg.load_plugins_by_path(_plugins)
)
An interface with our custom type can then be added:
ipr = IPRoute()
ipr.link("add", kind="custom-kind", msgfield1="data")
As of version 0.6, the link("add")
results in pr2modules.netlink.exceptions.NetlinkError: (22, 'Invalid argument')
. Some investigation revealed that the ifinfmsg
instance visible to the IPRoute
object did not have its ifinfo.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.
Activity