-
Notifications
You must be signed in to change notification settings - Fork 39
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
Select generic SNMPHandler
for Cisco Small Business switches in PortAdmin
#3250
Select generic SNMPHandler
for Cisco Small Business switches in PortAdmin
#3250
Conversation
Existing netbox mock fixtures needed to be updated with proper sysObjectID value mocking as well, since the selection logic for handlers will become more complex.
Cisco small business switches do not actually work like other Cisco products SNMP-wise, and we need to revert to the generic handler to make them work with PortAdmin
This pushes the logic of PortAdmin management handler selection to the handlers themselves, making it easier to implement more complex selection logic if needed. It seems more correct to let the handler classes decide for themselves whether a given Netbox is compatible. A `can_handle()` class method is added to `ManagementHandler`, whose default implementation is based on the existing "selection by `VENDOR` id" scheme. The extra logic for Cisco-but-not-quite-Cisco can therefore be pushed into a specific `can_handle()` implementation for the Cisco handler.
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
Test results 9 files 9 suites 8m 13s ⏱️ Results for commit b6c327d. ♻️ This comment has been updated with latest results. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3250 +/- ##
=======================================
Coverage 60.33% 60.34%
=======================================
Files 606 606
Lines 43700 43710 +10
Branches 48 48
=======================================
+ Hits 26366 26376 +10
Misses 17322 17322
Partials 12 12 ☔ View full report in Codecov by Sentry. |
Make the fallback algorithm more explicit, as per code review comments.
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like the new refactor
This fixes #3249 in two rounds, after introducing/updating tests for the issue at hand: