You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by sa...@apache.org on 2014/04/28 07:52:08 UTC

git commit: updated refs/heads/4.4-forward to 6f7f999

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 <sa...@citrix.com>
Authored: Mon Apr 28 10:40:06 2014 +0530
Committer: Sanjay Tripathi <sa...@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>();