JoaoJandre commented on code in PR #9564:
URL: https://github.com/apache/cloudstack/pull/9564#discussion_r4412578208
##########
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);
Review Comment:
Since we are already doing account scope, should we also add a domain scope?
##########
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) {
Review Comment:
I don't understand why implement this in the interface. We should move the
implementation to StorageManagerImpl
--
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]