You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/07/29 04:06:51 UTC

[GitHub] [cloudstack] GabrielBrascher commented on pull request #4714: Cleaning up code and enhancing a few IP management logs

GabrielBrascher commented on pull request #4714:
URL: https://github.com/apache/cloudstack/pull/4714#issuecomment-888784092


   > @GabrielBrascher I have no opinion to speak of ;
   > 
   > > Additionally, method `com.cloud.network.NetworkModelImpl.areServicesEnabledInZone` does not use list `checkedProvider`; the respective list should either be removed or populated.
   > > I have chosen to add provider names at `checkedProvider`, instead of removing it; however, I would appreciate any opinion/suggestion.
   > 
   > However, can you provide insight into your testing, i'm trusting the smoke tests a bit only. Any other testing needed?
   
   @DaanHoogland  the `checkedProvider` list is created to be used in order to avoid executing ` isProviderEnabledInPhysicalNetwork(physicalNtwkId, providerName)` multiple times for the same network provider.
   
   However, as it is not populated, the conditional `!checkedProvider.contains(providerName)` will always be true. Therefore that `List` is not usefull and loses its purpose. 
   
   For reference, the code:
   ```
           List<String> checkedProvider = new ArrayList<String>();
           for (Service service : services) {
               // get all the providers, and check if each provider is enabled
               List<String> providerNames = _ntwkOfferingSrvcDao.listProvidersForServiceForNetworkOffering(offering.getId(), service);
               for (String providerName : providerNames) {
                   if (!checkedProvider.contains(providerName)) {
                       result = result && isProviderEnabledInPhysicalNetwork(physicalNtwkId, providerName);
                   }
                   checkedProvider.add(providerName);
               }
   ```
   


-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org