CLOUDSTACK-6480: Creating Service Offering with Implict Dedication planner

fails with message:  "Please specify the pciDevice and vgpuType correctly".
This commit is contained in:
Sanjay Tripathi 2014-04-28 10:40:06 +05:30
parent 5a49bb2db7
commit 6f7f9996f2

View File

@ -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>();