You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/03/04 08:20:50 UTC

[GitHub] [cloudstack] DaanHoogland commented on a change in pull request #3925: Add cache mode param properly

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:
users@infra.apache.org


With regards,
Apache Git Services