-
Notifications
You must be signed in to change notification settings - Fork 37
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 power on string in cycle check: #105
Conversation
If action == v1.PowerAction_POWER_ACTION_CYCLE.String() then we set the requested power state to be "POWER_ACTION_ON". This causes the client.SetPowerState(ctx, pwrAction) to fail as the string "POWER_ACTION_ON" is not recognized by bmclib. We need to pass "on" as is done in 219. Signed-off-by: Jacob Weinstock <[email protected]>
Codecov Report
@@ Coverage Diff @@
## main #105 +/- ##
=======================================
Coverage 80.34% 80.34%
=======================================
Files 10 10
Lines 468 468
=======================================
Hits 376 376
Misses 79 79
Partials 13 13 Continue to review full report at Codecov.
|
Can has test? |
Only 3 words, but a great observation and point. This function definitely should have a test. I created #106 to capture this need. Apologizes, I know that doesn't help with this PR. Would you be comfortable with a follow-up PR to add tests? |
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.
This was a subtle one. Thank you for catching it!
Based on when this bug was introduced, I'd like the fix to land now and am comfortable with #106, having been filed, being left open for today. |
Description
This fixes power cycle requests. At line 307 If
action == v1.PowerAction_POWER_ACTION_CYCLE.String()
then we set the requested power state to be the string"POWER_ACTION_ON"
. This causes theclient.SetPowerState(ctx, pwrAction)
to fail as the string"POWER_ACTION_ON"
is not recognized by bmclib. We need to pass"on"
as is done in line 219.Why is this needed
Fixes: #
How Has This Been Tested?
Tested manually against
vaporio/ipmi-simulator
container image.How are existing users impacted? What migration steps/scripts do we need?
Checklist:
I have: