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/08/24 05:23:27 UTC

[GitHub] [cloudstack] atrocitytheme commented on pull request #5358: Fix potential NullPointerException in findStoragePool (VolumeOrchestrator)

atrocitytheme commented on pull request #5358:
URL: https://github.com/apache/cloudstack/pull/5358#issuecomment-904332053


   > I think it makes sense to move the check to the `getPreferredStoragePool() method`:
   > 
   > ```
   > private Optional<StoragePool> getPreferredStoragePool(List<StoragePool> poolList, VirtualMachine vm) {
   >    String accountStoragePoolUuid = null;
   >    if (vm != null) {
   >       accountStoragePoolUuid = StorageManager.PreferredStoragePool.valueIn(vm.getAccountId());
   >    }
   > ...
   > ```
   > 
   > Then the pool ID specified in the global setting (if set) will be picked instead of the first in the list of pools.
   
   Makes sense, just moved the checker to getPreferredStorge method


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