-
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
Fix PoE config not showing up for Cisco if interface is missing POEPort #2781
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## 5.8.x #2781 +/- ##
==========================================
- Coverage 57.03% 57.03% -0.01%
==========================================
Files 567 567
Lines 41280 41279 -1
==========================================
- Hits 23544 23543 -1
Misses 17736 17736 ☔ View full report in Codecov by Sentry. |
7572d30
to
92d67ce
Compare
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.
Actually, this should be rebased on the 5.8.x
branch for a bugfix release
POEIndexNotFoundError will be raised if POEPorts do not exist for an interface, and this is likely to be the case for an interface that does not support PoE. get_poe_states should set state to None for these interfaces, like it does if PoeNotSupportedError is raised.
interface not having poeport should be considered as the interface not supporting poe
e938081
to
33381e1
Compare
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.
rebased on 5.8.x myself, since you're on vacation :)
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
During navref, UIA mentioned that the new PoE Status column did not show up for their Cisco equipment.
Turns out this is because
get_poe_states
fails if even a single interface does not have a related POEPort object.This was originally intended functionality, even the cisco PoE tests reflects this behaviour. But I realize that a device not having a relation to a POEPort device simply means it does not support PoE, and in that case it should not crash the entire function. It should instead set the state for that interface to
None
as specified in the docstring forget_poe_states
This PR fixes this and updates tests accordingly. It also updates
set_poe_state
to behave similarly when it comes to missing PoE indexesAlso fixes a small issue with tests where the property for certain mock objects were named incorrectly.