nvazquez commented on code in PR #9564:
URL: https://github.com/apache/cloudstack/pull/9564#discussion_r4437684271


##########
engine/components-api/src/main/java/com/cloud/storage/StorageManager.java:
##########
@@ -447,4 +451,25 @@ void connectHostsToPool(DataStore primaryStore, List<Long> 
hostIds, Scope scope,
     static ConfigKey<Boolean> getMountDisabledStoragePool() {
         return MountDisabledStoragePool;
     }
+
+    /**
+     * Resolves the preferred storage pool UUID, checking the Account scope 
first, then the Cluster scope and finally the Global value.
+     * @return a pair of the scope where the value was found and the storage 
pool UUID, or null if it is not set at any level
+     */
+    static Pair<ConfigKey.Scope, String> getPreferredStoragePoolUuid(Long 
accountId, Long clusterId) {
+        if (accountId != null) {
+            String uuid = 
PreferredStoragePool.valueInScope(ConfigKey.Scope.Account, accountId, true);
+            if (StringUtils.isNotBlank(uuid)) {
+                return new Pair<>(ConfigKey.Scope.Account, uuid);

Review Comment:
   I think that may add some complexity to the logic, but can be a good 
enhancement. Would like to address it in a separate follow up PR, leaving this 
PR to the extension of the setting only



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