Add isolated MIB loaders to support multiple sets of MIBs
I have added a MibLoader class in the mib module so you can load and use isolated sets of MIBs. It uses the dataset feature of libsmi (smiInit("tag:dataset")). I have added some simple tests for it, and all the existing tests are passing (on my machine at least). One issue is that AFAIK there is not way to release the memory of only that dataset, so if you want to start from scratch you need to reset libsmi completely. The goal is to support multiple agents with different versions of the same MIB.
Let me know if there are other things I need to do.
Coverage decreased (-0.2%) to 89.134% when pulling 86cb8d64099661114f69afc14408ef63f8891afe on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Thanks! The diff is huge, but I suppose GitHub is just confused about whitespaces. I will look at it more later. As for the test errors, Python 2.6 needs {0}.format(...). I don't know where the error with PySNMP 4.2 comes from. I can have a look at it later, but feel free to add commits to this PR if you can fix that.
OK, I will also have a look at the failures. The big diff in mib.py is moving the functions into a class. I also added method calls to the mibloader in test_mib.py instead of functions. And last I duplicated the snimpy mib with different names to allow tests on an different mib set, and the test agent loads both mibs.
Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c515e087df4256fdd3198b72c76bf96a088 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c515e087df4256fdd3198b72c76bf96a088 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c515e087df4256fdd3198b72c76bf96a088 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c515e087df4256fdd3198b72c76bf96a088 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c515e087df4256fdd3198b72c76bf96a088 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c515e087df4256fdd3198b72c76bf96a088 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c515e087df4256fdd3198b72c76bf96a088 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Coverage decreased (-0.2%) to 89.134% when pulling 8c2c1bbff1ed24750484a1767f209bcd716d1cd4 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Coverage decreased (-0.2%) to 89.134% when pulling 135db30a69bad6f9f81d2c74406ea57a39e689d6 on iwanb:master into 123ca18b06426b360d4c92e28fa46fa05d81c311 on vincentbernat:master.
Any idea about the error with PySNMP 4.2? I cannot reproduce it on my computer and I really don't see where it could come from.
Dunno. But I'll look more into it later (at the same time I'll read your changes). I will be unavailable for a week soon, so it can take two weeks for me to do something.
I didn't forget about the PR, but I am lacking time. Please, be patient.