JoaoJandre opened a new pull request #5835: URL: https://github.com/apache/cloudstack/pull/5835
### Description This PR aims to fix the "blank domain UUID" situation, in which the user may provide an empty string as the UUID to the createDomain API. This situation can cause misleading actions in the UI (user trying to delete the wrong domain), and it also makes it impossible to remove the domain that has an empty UUID. The createDomain API is not testing for empty strings or strings filled with whitespaces; therefore, it is allowing users to create a domain with an invalid UUID. Unless the UUID is manually changed in the DB, it is impossible to work with (or to delete) it. The proposed solution is to generate a random valid UUID when the given one is a blank; thus, preventing the reported problem. Besides that, I decided to refactor a little bit the createDomain method, and added unit tests for its whole processing. Then, we are able to guarantee its workings. ### 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) ### Feature/Enhancement Scale or Bug Severity #### Feature/Enhancement Scale - [ ] Major - [X] Minor #### Bug Severity - [ ] BLOCKER - [ ] Critical - [ ] Major - [X] Minor - [ ] Trivial ### How Has This Been Tested? - New unit tests were created to test the behavior of the new methods and changed ones. - It was also tested in a local lab, by creating new domains with blank UUIDs (for example with whitespaces and empty strings) and checking if the created domains would have valid generated UUIDs. -- 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]
