CLOUDSTACK-9135 - Makes possible to add multiple providers per service

- Same is done in the Java side. Check the createVpcOffering() method in the VpcManagerImpl class
This commit is contained in:
Wilder Rodrigues 2015-12-11 15:02:55 +01:00
parent 632ee18ab7
commit 590af145b0
1 changed files with 13 additions and 5 deletions

View File

@ -4055,17 +4055,25 @@ class VpcOffering:
@classmethod
def create(cls, apiclient, services):
"""Create vpc offering"""
import logging
cmd = createVPCOffering.createVPCOfferingCmd()
cmd.name = "-".join([services["name"], random_gen()])
cmd.displaytext = services["displaytext"]
cmd.supportedServices = services["supportedservices"]
if "serviceProviderList" in services:
for service, provider in services["serviceProviderList"].items():
cmd.serviceproviderlist.append({
'service': service,
'provider': provider
})
providers = provider
if isinstance(provider, str):
providers = [provider]
for provider_item in providers:
cmd.serviceproviderlist.append({
'service': service,
'provider': provider_item
})
if "serviceCapabilityList" in services:
cmd.servicecapabilitylist = []
for service, capability in \