CLOUDSTACK-6654: Configkey parameters are not validated

(cherry picked from commit 5bcd017de6)
This commit is contained in:
Saksham Srivastava 2014-06-10 18:27:54 +05:30 committed by Daan Hoogland
parent 23b7993d58
commit 9771e79b1b
1 changed files with 16 additions and 3 deletions

View File

@ -701,12 +701,19 @@ public class ConfigurationManagerImpl extends ManagerBase implements Configurati
return "Invalid scope id provided for the parameter " + name;
}
}
Class<?> type = null;
Config c = Config.getConfig(name);
if (c == null) {
s_logger.warn("Did not find configuration " + name + " in Config.java. Perhaps moved to ConfigDepot?");
return null;
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;
}
type = configKey.type();
} else {
type = c.getType();
}
Class<?> type = c.getType();
if (value == null) {
if (type.equals(Boolean.class)) {
@ -765,6 +772,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();
if (range == null) {
return null;