GutoVeronezi opened a new pull request, #6510:
URL: https://github.com/apache/cloudstack/pull/6510

   ### Description
   
   While deleting a traffic type, ACS validates if there is any VM related to 
it. However, if we have several physical networks containing a traffic type, 
ACS does not filter the physical network to do the validation. For instance, if 
we have two (2) physical networks containing the traffic type Guest, the first 
one having VMs related, and the second not having VMs related, if we try to 
remove the second traffic type, ACS give us the message `The Traffic Type is 
not deletable because there are existing networks with this traffic type:Guest`.
   
   The API `deleteTrafficType` was designed to filter the physical network 
where the traffic type is, however, due to a typo this filtering was not been 
applied correctly. This PR intends to fix this typo to honor the API behavior.
   
   ### 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
   
   #### Bug Severity
   
   - [ ] BLOCKER
   - [ ] Critical
   - [ ] Major
   - [x] Minor
   - [ ] Trivial
   
   
   ### How Has This Been Tested?
   
   In an advanced zone I created 4 physical networks, one for each traffic type 
(Public, Guest, Management, Storage). I instantied some VMs so they get guest 
IPs. In the Public physical network I added a Guest traffic type. I tried to 
remove the new Guest traffic type from Public physical network, which did not 
have any VMs related to it, and, before the changes, I was getting the message 
`The Traffic Type is not deletable because there are existing networks with 
this traffic type:Guest`. After the changes, I could remove successfully the 
new Guest traffic type via API deleteTrafficType. I also tried to remove the 
Guest traffic type which had VMs related to it, however, as expected, I 
received the `The Traffic Type is not deletable...` message.
   
   I also created a unit test to validate the data retrieving.


-- 
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]

Reply via email to