abh1sar commented on code in PR #11567:
URL: https://github.com/apache/cloudstack/pull/11567#discussion_r2427038725
##########
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:
For Global scope value() is good enough, right?
why do we need this code?
--
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]