X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fnfvo.py;h=bd5b5d6d9e3ecee7c156f60e58d31f004c7d73fe;hb=f145087b6237ec668786806da2a90ac8aadcbd6e;hp=df046f4525a89d26c7e089122708c7298ee6e743;hpb=0ea2a7e95b99313472ead86705261ee38b67ce56;p=osm%2FRO.git diff --git a/osm_ro/nfvo.py b/osm_ro/nfvo.py index df046f45..bd5b5d6d 100644 --- a/osm_ro/nfvo.py +++ b/osm_ro/nfvo.py @@ -2823,19 +2823,15 @@ def create_instance(mydb, tenant_id, instance_dict): create_network = True lookfor_network = False - if lookfor_network and create_network: - # TODO create two tasks FIND + CREATE with their relationship - task_action = "FIND" - task_params = (lookfor_filter,) - # task_action = "CREATE" - # task_params = (net_vim_name, net_type, sce_net.get('ip_profile', None)) - # task + task_extra = {} + if create_network: + task_action = "CREATE" + task_extra["params"] = (net_vim_name, net_type, sce_net.get('ip_profile', None)) + if lookfor_network: + task_extra["find"] = (lookfor_filter,) elif lookfor_network: task_action = "FIND" - task_params = (lookfor_filter,) - elif create_network: - task_action = "CREATE" - task_params = (net_vim_name, net_type, sce_net.get('ip_profile', None)) + task_extra["params"] = (lookfor_filter,) # fill database content net_uuid = str(uuid4()) @@ -2860,7 +2856,7 @@ def create_instance(mydb, tenant_id, instance_dict): "action": task_action, "item": "instance_nets", "item_id": net_uuid, - "extra": yaml.safe_dump({"params": task_params}, default_flow_style=True, width=256) + "extra": yaml.safe_dump(task_extra, default_flow_style=True, width=256) } net2task_id['scenario'][sce_net['uuid']][datacenter_id] = task_index task_index += 1