-
Notifications
You must be signed in to change notification settings - Fork 5
Add module for loading model and OID configuration. #43
Conversation
Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions. site-packages/mlab/disco/models.py, line 33 [r1] (raw file): site-packages/mlab/disco/models.py, line 124 [r1] (raw file): http://pyyaml.org/wiki/PyYAMLDocumentation#LoadingYAML Comments from Reviewable |
Use yaml.safe_load.
Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions. site-packages/mlab/disco/models.py, line 33 [r1] (raw file): site-packages/mlab/disco/models.py, line 124 [r1] (raw file): It looks like Comments from Reviewable |
Review status: 0 of 2 files reviewed at latest revision, 2 unresolved discussions. site-packages/mlab/disco/models.py, line 124 [r1] (raw file): Comments from Reviewable |
Review status: 0 of 4 files reviewed at latest revision, 2 unresolved discussions. site-packages/mlab/disco/models.py, line 124 [r1] (raw file): There are a few caveats to Comments from Reviewable |
Reviewed 3 of 4 files at r4, 1 of 1 files at r5. disco/models.yaml, line 1 [r5] (raw file): disco/models.yaml, line 13 [r5] (raw file): disco/models.yaml, line 16 [r5] (raw file): disco/models.yaml, line 37 [r5] (raw file): Edit: After reading the rest of the code, I think the answer is that it's just a string. I'm not sure how obvious this would be to someone who's comfortable enough with YAML to recognize it as not YAML syntax. Maybe we could document that I'm still a little confused about why the format string variable is called site-packages/mlab/disco/models.py, line 18 [r5] (raw file): site-packages/mlab/disco/models.py, line 28 [r5] (raw file): site-packages/mlab/disco/models.py, line 92 [r5] (raw file): site-packages/mlab/disco/models.py, line 93 [r5] (raw file): site-packages/mlab/disco/models.py, line 124 [r5] (raw file): site-packages/mlab/disco/models.py, line 167 [r5] (raw file): site-packages/mlab/disco/models_test.py, line 11 [r5] (raw file): site-packages/mlab/disco/models_test.py, line 28 [r5] (raw file): site-packages/mlab/disco/models_test.py, line 90 [r5] (raw file): Comments from Reviewable |
Update test to verify that "oid override" works as intended. Update documentation in model.yaml.
Review status: 1 of 4 files reviewed at latest revision, 13 unresolved discussions. disco/models.yaml, line 1 [r5] (raw file): The disco/models.yaml, line 13 [r5] (raw file): How does it look? disco/models.yaml, line 16 [r5] (raw file): disco/models.yaml, line 37 [r5] (raw file): "ifIndex" is an SNMP thing that basically means port... most of the time. I changed the parameter to lookup_oids to use I was trying to be helpful to humans who may understand what a switch port is but not be sure of what an ifindex is. But, this may be another example where some domain familiarity is necessary and using ifIndex throughout is actually more helpful by hinting that "you need to know what an ifindex is." site-packages/mlab/disco/models.py, line 18 [r5] (raw file): site-packages/mlab/disco/models.py, line 28 [r5] (raw file): site-packages/mlab/disco/models.py, line 92 [r5] (raw file): site-packages/mlab/disco/models.py, line 93 [r5] (raw file): site-packages/mlab/disco/models.py, line 124 [r5] (raw file): site-packages/mlab/disco/models.py, line 167 [r5] (raw file): site-packages/mlab/disco/models_test.py, line 11 [r5] (raw file): site-packages/mlab/disco/models_test.py, line 28 [r5] (raw file): site-packages/mlab/disco/models_test.py, line 90 [r5] (raw file): Comments from Reviewable |
Reviewed 3 of 3 files at r6. disco/models.yaml, line 60 [r6] (raw file): disco/models.yaml, line 62 [r6] (raw file): site-packages/mlab/disco/models.py, line 142 [r6] (raw file): site-packages/mlab/disco/models_test.py, line 90 [r5] (raw file): https://github.com/google/yapf/issues Comments from Reviewable |
Minor typo corrections.
Review status: 2 of 4 files reviewed at latest revision, 4 unresolved discussions. disco/models.yaml, line 60 [r6] (raw file): disco/models.yaml, line 62 [r6] (raw file): site-packages/mlab/disco/models.py, line 142 [r6] (raw file): site-packages/mlab/disco/models_test.py, line 90 [r5] (raw file): Comments from Reviewable |
This PR includes a configuration file for known switch models and a module for loading and interpreting the configuration.
This change is