Skip to content
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

Add isolated MIB loaders to support multiple sets of MIBs #68

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

iwanb
Copy link

@iwanb iwanb commented Feb 5, 2017

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.

@coveralls
Copy link

coveralls commented Feb 5, 2017

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 86cb8d6 on iwanb:master into 123ca18 on vincentbernat:master.

@vincentbernat
Copy link
Owner

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.

@iwanb
Copy link
Author

iwanb commented Feb 5, 2017

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.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c5 on iwanb:master into 123ca18 on vincentbernat:master.

6 similar comments
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c5 on iwanb:master into 123ca18 on vincentbernat:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c5 on iwanb:master into 123ca18 on vincentbernat:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c5 on iwanb:master into 123ca18 on vincentbernat:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c5 on iwanb:master into 123ca18 on vincentbernat:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c5 on iwanb:master into 123ca18 on vincentbernat:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 2ba44c5 on iwanb:master into 123ca18 on vincentbernat:master.

@coveralls
Copy link

coveralls commented Feb 5, 2017

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 8c2c1bb on iwanb:master into 123ca18 on vincentbernat:master.

@coveralls
Copy link

coveralls commented Feb 7, 2017

Coverage Status

Coverage decreased (-0.2%) to 89.134% when pulling 135db30 on iwanb:master into 123ca18 on vincentbernat:master.

@iwanb
Copy link
Author

iwanb commented Feb 7, 2017

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.

@vincentbernat
Copy link
Owner

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.

@vincentbernat
Copy link
Owner

I didn't forget about the PR, but I am lacking time. Please, be patient.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants