You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we are running peering-manager, which uses the wonderful NAPALM library to fetch data from routers.
For some reason we are still running IOS devices from the stone age in some locations, which causes us a little issue - NAPALM is of course perfectly fine talking to these devices, as the built-in IOSDriver "just works" (thanks again to all the wonderful people contributing to this great piece of software!).
BUT peering-manager then wants to process that data, and stores that data in redis for caching - and this is where the trouble starts, because apparently, the data that is returned by IOSDriver.get_bgp_neighbors_detail() does not like to be pickled. It is my understanding that this is because it uses a defaultdict in combination with a lambda function to generate a nested defaultdict, and only named functions can be pickled, not lambdas.
As far as I can see, there are two simple solutions to this:
replace the lambda function with a named function:
@mirceaulinic, @ktbyers, is there something I can do to make evaluating this issue and the associated PRs easier for you?
I understand you probably have important things to do so I would like to make it as easy for you as possible to review this minor request.
Maybe a TL,DR:
My proposed changes do not change the logical behaviour of the IOSDriver at all, it's just replacing a lambda function with a named function so the object can be pickled.
Thank you very much for the great work you have put into NAPALM!
Cheers,
we are running peering-manager, which uses the wonderful NAPALM library to fetch data from routers.
For some reason we are still running IOS devices from the stone age in some locations, which causes us a little issue - NAPALM is of course perfectly fine talking to these devices, as the built-in
IOSDriver
"just works" (thanks again to all the wonderful people contributing to this great piece of software!).BUT peering-manager then wants to process that data, and stores that data in redis for caching - and this is where the trouble starts, because apparently, the data that is returned by
IOSDriver.get_bgp_neighbors_detail()
does not like to be pickled. It is my understanding that this is because it uses a defaultdict in combination with a lambda function to generate a nested defaultdict, and only named functions can be pickled, not lambdas.As far as I can see, there are two simple solutions to this:
or
2) don't use defaultdicts at all, and create the missing dicts / list manually (as is done e.g. in the
IOSXRDriver
)happy to implement this, just let me know which one you prefer.
The text was updated successfully, but these errors were encountered: