mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-6654: Configkey parameters are not validated
This commit is contained in:
parent
f2464e4182
commit
41030e4e3e
@ -702,12 +702,19 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||||||
return "Invalid scope id provided for the parameter " + name;
|
return "Invalid scope id provided for the parameter " + name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Class<?> type = null;
|
||||||
Config c = Config.getConfig(name);
|
Config c = Config.getConfig(name);
|
||||||
if (c == null) {
|
if (c == null) {
|
||||||
s_logger.warn("Did not find configuration " + name + " in Config.java. Perhaps moved to ConfigDepot?");
|
s_logger.warn("Did not find configuration " + name + " in Config.java. Perhaps moved to ConfigDepot");
|
||||||
|
ConfigKey<?> configKey = _configDepot.get(name);
|
||||||
|
if(configKey == null) {
|
||||||
|
s_logger.warn("Did not find configuration " + name + " in ConfigDepot too.");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
Class<?> type = c.getType();
|
type = configKey.type();
|
||||||
|
} else {
|
||||||
|
type = c.getType();
|
||||||
|
}
|
||||||
|
|
||||||
if (value == null) {
|
if (value == null) {
|
||||||
if (type.equals(Boolean.class)) {
|
if (type.equals(Boolean.class)) {
|
||||||
@ -766,6 +773,12 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(c == null ) {
|
||||||
|
//range validation has to be done per case basis, for now
|
||||||
|
//return in case of Configkey parameters
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
String range = c.getRange();
|
String range = c.getRange();
|
||||||
if (range == null) {
|
if (range == null) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user