-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix hostId verification on unsuccessful expunge operation #10418
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 hostId verification on unsuccessful expunge operation #10418
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #10418 +/- ##
=========================================
Coverage 15.98% 15.99%
- Complexity 13079 13080 +1
=========================================
Files 5649 5649
Lines 495625 495625
Branches 60004 60004
=========================================
+ Hits 79244 79257 +13
+ Misses 407539 407520 -19
- Partials 8842 8848 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
@nicoschmdt , I see this bug is also present in 4.20, could you rebase your code on that branch please? |
f674ee6 to
092fa35
Compare
Pearl1594
left a comment
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.
clgtm
|
@blueorangutan package |
|
@Pearl1594 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12513 |
|
@blueorangutan test |
|
@Pearl1594 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian test result (tid-12472)
|
Description
In Java, the operator and has a higher precedence than the operator or. This caused the method
handleUnsuccessfulExpungeOperationto execute even when thehostIdorlastHostIdvalue wasnull, allowing CloudStack to send a command to a host that doesn't exist.This PR fixes this verification logic adding parenthesis to ensure the method will not execute when the value of the parameter
hostIdisnull.To reproduce this error you need to deploy a VM with a tag with no matches and then try to expunge it.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
How Has This Been Tested?
Through debug mode I tested different values for
finalizeExpungeCommands,nicExpungeCommandsandhostIdand I checked that it is not possible to execute the method whenhostIdis null or when both of the command lists are empty.