cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanjaytripa...@apache.org
Subject git commit: updated refs/heads/4.4-forward to 6f7f999
Date Mon, 28 Apr 2014 05:52:08 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4-forward 5a49bb2db -> 6f7f9996f


CLOUDSTACK-6480: Creating Service Offering with Implict Dedication planner
fails with message:  "Please specify the pciDevice and vgpuType correctly".


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

Branch: refs/heads/4.4-forward
Commit: 6f7f9996f2367b33f56a45b7b11d9720b94fcd55
Parents: 5a49bb2
Author: Sanjay Tripathi <sanjay.tripathi@citrix.com>
Authored: Mon Apr 28 10:40:06 2014 +0530
Committer: Sanjay Tripathi <sanjay.tripathi@citrix.com>
Committed: Mon Apr 28 11:24:41 2014 +0530

----------------------------------------------------------------------
 .../src/com/cloud/configuration/ConfigurationManagerImpl.java | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6f7f9996/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
index 30afd7b..a3d31a6 100755
--- a/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
+++ b/server/src/com/cloud/configuration/ConfigurationManagerImpl.java
@@ -2085,8 +2085,11 @@ public class ConfigurationManagerImpl extends ManagerBase implements
Configurati
 
         List<ServiceOfferingDetailsVO> detailsVO = null;
         if (details != null) {
-            // Check if the user has passed the gpu-type before passing the VGPU type
-            if (!details.containsKey(GPU.Keys.pciDevice.toString()) || !details.containsKey(GPU.Keys.vgpuType.toString()))
{
+            // To have correct input, either both gpu card name and VGPU type should be passed
or nothing should be passed.
+            // Use XOR condition to verify that.
+            boolean entry1 = details.containsKey(GPU.Keys.pciDevice.toString());
+            boolean entry2 = details.containsKey(GPU.Keys.vgpuType.toString());
+            if ((entry1 || entry2) && !(entry1 && entry2)) {
                 throw new InvalidParameterValueException("Please specify the pciDevice and
vgpuType correctly.");
             }
             detailsVO = new ArrayList<ServiceOfferingDetailsVO>();


Mime
View raw message