DaanHoogland commented on a change in pull request #3925: Add cache mode param 
properly
URL: https://github.com/apache/cloudstack/pull/3925#discussion_r387500896
 
 

 ##########
 File path: 
server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
 ##########
 @@ -2936,6 +2948,11 @@ public DiskOffering createDiskOffering(final 
CreateDiskOfferingCmd cmd) {
             throw new InvalidParameterValueException("Disksize is not allowed 
for a customized disk offering");
         }
 
+        // check if valid cache_mode parameter
+        if(cmd.getCacheMode() != null && 
!Enums.getIfPresent(DiskOffering.DiskCacheMode.class, 
cmd.getCacheMode().toUpperCase()).isPresent()){
+            throw new InvalidParameterValueException("Please specify a valid 
cache mode parameter");
+        }
+
 
 Review comment:
   can you put this in its own method.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to