From 2148a1a64d6d652b7aa24077daaaa331a85173ce Mon Sep 17 00:00:00 2001 From: SrikanteswaraRao Talluri Date: Mon, 30 Jun 2014 19:20:07 +0530 Subject: [PATCH] =?UTF-8?q?CLOUDSTACK-7009:=20add=20ability=20to=20handle?= =?UTF-8?q?=20serviceofferingdetails=20to=20base.py=20to=20support=20creat?= =?UTF-8?q?ion=20of=20service=20offering=20upon=20passing=20details=20in?= =?UTF-8?q?=20the=20=20following=20format=20=C2=A0=20=C2=A0=20=C2=A0=20?= =?UTF-8?q?=C2=A0=20=C2=A0=20=C2=A0=20serviceofferingdetails[1].key=3DpciD?= =?UTF-8?q?evice=20=C2=A0=20=C2=A0=20=C2=A0=20=C2=A0=20=C2=A0=20=C2=A0=20s?= =?UTF-8?q?erviceofferingdetails[1].value=3DGroup=20of=20NVIDIA=20Corporat?= =?UTF-8?q?ion=20GK107GL=20[GRID=20K1]=20GPUs=20=C2=A0=20=C2=A0=20=C2=A0?= =?UTF-8?q?=20=C2=A0=20=C2=A0=20=C2=A0=20serviceofferingdetails[2].key=3Dv?= =?UTF-8?q?gpuType=20=C2=A0=20=C2=A0=20=C2=A0=20=C2=A0=20=C2=A0=20=C2=A0?= =?UTF-8?q?=20serviceofferingdetails[2].value=3DGRID=20K120Q?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/integration/smoke/test_deploy_vgpu_enabled_vm.py | 3 ++- tools/marvin/marvin/lib/base.py | 8 ++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py index 13c1e5e11fe..2188c7f2165 100644 --- a/test/integration/smoke/test_deploy_vgpu_enabled_vm.py +++ b/test/integration/smoke/test_deploy_vgpu_enabled_vm.py @@ -75,11 +75,12 @@ class TestDeployvGPUenabledVM(cloudstackTestCase): self.testdata["vgpu140q"]["zoneid"] = self.zone.id self.testdata["vgpu140q"]["template"] = self.template.id + self.testdata["service_offerings"]["vgpu260qwin"]["serviceofferingdetails"] = [{'pciDevice': 'VGPU'}, + {'vgpuType':'GRID K120Q'}] #create a service offering self.service_offering = ServiceOffering.create( self.apiclient, self.testdata["service_offerings"]["vgpu260qwin"], - serviceofferingdetails={'pciDevice': 'VGPU'} ) #build cleanup list self.cleanup = [ diff --git a/tools/marvin/marvin/lib/base.py b/tools/marvin/marvin/lib/base.py index 7d2622eb7c8..2ef6f8209b2 100755 --- a/tools/marvin/marvin/lib/base.py +++ b/tools/marvin/marvin/lib/base.py @@ -1866,8 +1866,12 @@ class ServiceOffering: cmd.deploymentplanner = services["deploymentplanner"] if "serviceofferingdetails" in services: - cmd.serviceofferingdetails.append( - {services['serviceofferingdetails']}) + count = 1 + for i in services["serviceofferingdetails"]: + for key, value in i.items(): + setattr(cmd, "serviceofferingdetails[%d].key" % count, key) + setattr(cmd, "serviceofferingdetails[%d].value" % count, value) + count = count + 1 if "isvolatile" in services: cmd.isvolatile = services["isvolatile"]