sureshanaparti commented on code in PR #11567:
URL: https://github.com/apache/cloudstack/pull/11567#discussion_r2428148738


##########
framework/config/src/main/java/org/apache/cloudstack/framework/config/impl/ConfigDepotImpl.java:
##########
@@ -296,6 +296,27 @@ protected String 
getConfigStringValueInternal(Ternary<String, ConfigKey.Scope, L
         return null;
     }
 
+    public boolean doesConfigKeyAndValueExistInScope(String key, String value, 
ConfigKey.Scope scope) {
+        if (!ConfigKey.Scope.Global.equals(scope)) {
+            ScopedConfigStorage scopedConfigStorage = null;
+            for (ScopedConfigStorage storage : _scopedStorages) {
+                if (storage.getScope() == scope) {
+                    scopedConfigStorage = storage;
+                }
+            }
+            if (scopedConfigStorage == null) {
+                logger.warn("Unable to check existence of config key {} and 
value {} in scope: {}, couldn't find config storage for this scope", key, 
value, scope);
+                return false;
+            }
+            return scopedConfigStorage.doesConfigKeyAndValueExist(key, value);
+        }
+        ConfigurationVO configurationVO = _configDao.findByName(key);
+        if (configurationVO != null) {

Review Comment:
   @abh1sar some earlier config keys are not part of config framework, so these 
are fetched directly from the db. it's the same with the current method 
_getConfigStringValueInternal()_ as well.



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