nicoschmdt opened a new pull request, #10418: URL: https://github.com/apache/cloudstack/pull/10418
### Description In Java, the operator and has a higher precedence than the operator or. This caused the method `handleUnsuccessfulExpungeOperation` to execute even when the `hostId` or `lastHostId` value was `null`, 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 `hostId` is `null`. 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 - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] build/CI - [ ] test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [ ] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [x] Minor - [ ] Trivial ### How Has This Been Tested? Through debug mode I tested different values for `finalizeExpungeCommands`, `nicExpungeCommands` and `hostId` and I checked that it is not possible to execute the method when `hostId` is null or when both of the command lists are empty. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
