X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fnfvo.py;fp=osm_ro%2Fnfvo.py;h=4b7ecc415ae12c9139bc90c5dbbd80b95c70bfae;hb=4070e445031751ffe371b44928580f0ff6f383c9;hp=4341422f60ac0bcd4e03820b3fb61f618917d9c7;hpb=db1b22de8331161d80ef3a65ffd41ba8ea206cb9;p=osm%2FRO.git diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index 4341422f..4b7ecc41 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -3205,13 +3205,15 @@ def create_instance(mydb, tenant_id, instance_dict): # --> WIM # TODO: use this information during network creation - wim_account_id = None + wim_account_id = wim_account_name = None if len(involved_datacenters) > 1 and 'uuid' in sce_net: # OBS: sce_net without uuid are used internally to VNFs # and the assumption is that VNFs will not be split among # different datacenters - wim_account_id = wim_engine.find_suitable_wim_account( + wim_account = wim_engine.find_suitable_wim_account( involved_datacenters, tenant_id) + wim_account_id = wim_account['uuid'] + wim_account_name = wim_account['name'] wim_usage[sce_net['uuid']] = wim_account_id # <-- WIM @@ -3303,7 +3305,7 @@ def create_instance(mydb, tenant_id, instance_dict): task_extra = {} if create_network: task_action = "CREATE" - task_extra["params"] = (net_vim_name, net_type, sce_net.get('ip_profile', None)) + task_extra["params"] = (net_vim_name, net_type, sce_net.get('ip_profile', None), wim_account_name) if lookfor_network: task_extra["find"] = (lookfor_filter,) elif lookfor_network: @@ -5550,9 +5552,8 @@ def datacenter_sdn_port_mapping_set(mydb, tenant_id, datacenter_id, sdn_port_map pci = port.get("pci") element["switch_port"] = port.get("switch_port") element["switch_mac"] = port.get("switch_mac") - if not pci or not (element["switch_port"] or element["switch_mac"]): - raise NfvoException ("The mapping must contain the 'pci' and at least one of the elements 'switch_port'" - " or 'switch_mac'", httperrors.Bad_Request) + if not element["switch_port"] and not element["switch_mac"]: + raise NfvoException ("The mapping must contain 'switch_port' or 'switch_mac'", httperrors.Bad_Request) for pci_expanded in utils.expand_brackets(pci): element["pci"] = pci_expanded maps.append(dict(element))