Pearl1594 commented on code in PR #9628:
URL: https://github.com/apache/cloudstack/pull/9628#discussion_r1743970373


##########
framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java:
##########
@@ -268,6 +277,48 @@ public ConfigurationDao global() {
         return _configDao;
     }
 
+    protected String getConfigStringValueInternal(String cacheKey) {
+        String[] parts = cacheKey.split("-");
+        String key = parts[0];
+        ConfigKey.Scope scope = ConfigKey.Scope.Global;
+        Long scopeId = null;
+        try {
+            scope = ConfigKey.Scope.valueOf(parts[1]);
+            scopeId = Long.valueOf(parts[2]);
+        } catch (IllegalArgumentException ignored) {}
+        if (!ConfigKey.Scope.Global.equals(scope) && scopeId != null) {
+            ScopedConfigStorage scopedConfigStorage = null;
+            for (ScopedConfigStorage storage : _scopedStorages) {
+                if (storage.getScope() == scope) {
+                    scopedConfigStorage = storage;
+                }
+            }
+            if (scopedConfigStorage == null) {
+                throw new CloudRuntimeException("Unable to find config storage 
for this scope: " + scope + " for " + key);

Review Comment:
   Should we fail here? Or get the value from the DB in this case?



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