Skip to content

Commit 15e2e82

Browse files
bernardodemarcoLocharla, Sandeep
authored andcommitted
Change the value parameter of the updateConfiguration API to be required (apache#10790)
1 parent 3c38b50 commit 15e2e82

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,10 @@ public Configuration updateConfiguration(final UpdateCfgCmd cmd) throws InvalidP
10431043
category = config.getCategory();
10441044
}
10451045

1046+
if (value == null) {
1047+
throw new InvalidParameterValueException(String.format("The new value for the [%s] configuration must be given.", name));
1048+
}
1049+
10461050
validateIpAddressRelatedConfigValues(name, value);
10471051
validateConflictingConfigValue(name, value);
10481052

@@ -1051,10 +1055,6 @@ public Configuration updateConfiguration(final UpdateCfgCmd cmd) throws InvalidP
10511055
throw new CloudRuntimeException("Only Root Admin is allowed to edit this configuration.");
10521056
}
10531057

1054-
if (value == null) {
1055-
return _configDao.findByName(name);
1056-
}
1057-
10581058
ConfigKey.Scope scope = null;
10591059
Long id = null;
10601060
int paramCountCheck = 0;

0 commit comments

Comments
 (0)