Skip to content

Commit bc3d7c3

Browse files
Change the value parameter of the updateConfiguration API to be required (#10790)
1 parent 425c4e3 commit bc3d7c3

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
@@ -1031,6 +1031,10 @@ public Configuration updateConfiguration(final UpdateCfgCmd cmd) throws InvalidP
10311031
category = config.getCategory();
10321032
}
10331033

1034+
if (value == null) {
1035+
throw new InvalidParameterValueException(String.format("The new value for the [%s] configuration must be given.", name));
1036+
}
1037+
10341038
validateIpAddressRelatedConfigValues(name, value);
10351039
validateConflictingConfigValue(name, value);
10361040

@@ -1039,10 +1043,6 @@ public Configuration updateConfiguration(final UpdateCfgCmd cmd) throws InvalidP
10391043
throw new CloudRuntimeException("Only Root Admin is allowed to edit this configuration.");
10401044
}
10411045

1042-
if (value == null) {
1043-
return _configDao.findByName(name);
1044-
}
1045-
10461046
ConfigKey.Scope scope = null;
10471047
Long id = null;
10481048
int paramCountCheck = 0;

0 commit comments

Comments
 (0)