cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sw...@apache.org
Subject [1/2] git commit: updated refs/heads/master to c82d502
Date Fri, 13 May 2016 21:01:07 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 3343f1229 -> c82d50270


CLOUDSTACK-9199: Fixed deployVirtualMachine API does not throw an error when cpunumber is
specified for static compute offering


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/149f6c05
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/149f6c05
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/149f6c05

Branch: refs/heads/master
Commit: 149f6c05147a07abe845b53ed4d9bc159b68b0ff
Parents: 7e12ebf
Author: Anshul Gangwar <anshul.gangwar@citrix.com>
Authored: Wed Dec 23 12:12:44 2015 +0530
Committer: Anshul Gangwar <anshul.gangwar@citrix.com>
Committed: Wed Dec 23 12:12:44 2015 +0530

----------------------------------------------------------------------
 .../apache/cloudstack/api/command/user/vm/DeployVMCmd.java   | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/149f6c05/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
----------------------------------------------------------------------
diff --git a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
index 82c281d..cfd2627 100644
--- a/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
+++ b/api/src/org/apache/cloudstack/api/command/user/vm/DeployVMCmd.java
@@ -553,6 +553,14 @@ public class DeployVMCmd extends BaseAsyncCreateCustomIdCmd {
                 throw new InvalidParameterValueException("Unable to find service offering:
" + serviceOfferingId);
             }
 
+            if(!serviceOffering.isDynamic()) {
+                for(String detail: getDetails().keySet()) {
+                    if(detail.equalsIgnoreCase("cpuNumber") || detail.equalsIgnoreCase("cpuSpeed")
|| detail.equalsIgnoreCase("memory")) {
+                        throw new InvalidParameterValueException("cpuNumber or cpuSpeed or
memory should not be specified for static service offering");
+                    }
+                }
+            }
+
             VirtualMachineTemplate template = _entityMgr.findById(VirtualMachineTemplate.class,
templateId);
             // Make sure a valid template ID was specified
             if (template == null) {


Mime
View raw message