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/10/09 07:21:53 UTC

[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4376: server: Fix some cpuspeed issues while create service offering

sureshanaparti commented on a change in pull request #4376:
URL: https://github.com/apache/cloudstack/pull/4376#discussion_r502235288



##########
File path: server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java
##########
@@ -2319,9 +2319,9 @@ public ServiceOffering createServiceOffering(final CreateServiceOfferingCmd cmd)
                 throw new InvalidParameterValueException("For creating a custom compute offering cpu and memory all should be null");
             }
             // if any of them is null, then all of them shoull be null
-            if (maxCPU == null || minCPU == null || maxMemory == null || minMemory == null) {
-                if (maxCPU != null || minCPU != null || maxMemory != null || minMemory != null) {
-                    throw new InvalidParameterValueException("For creating a custom compute offering min/max cpu and min/max memory should all be specified");
+            if (maxCPU == null || minCPU == null || maxMemory == null || minMemory == null || cpuSpeed == null) {
+                if (maxCPU != null || minCPU != null || maxMemory != null || minMemory != null || cpuSpeed != null) {
+                    throw new InvalidParameterValueException("For creating a custom compute offering min/max cpu and min/max memory/cpu speed should all be null or all specified");
                 }
             } else {
                 if (cpuSpeed != null && (cpuSpeed.intValue() < 0 || cpuSpeed.longValue() > Integer.MAX_VALUE)) {

Review comment:
       `cpuSpeed` null check not required here, it is always not null as per the above changes.




----------------------------------------------------------------
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