X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=osm_ro%2Fvim_thread.py;h=455c625b40aabd8c2faa99785e8322bb8f5833c2;hp=8ed570cd6a82b4e137430cf7ff8a8e417f408b96;hb=30d0d6dfa518c5e439f4e004b97201b0eb51680a;hpb=8a2d20725d5b3ad32946affd7bea7388434094e9 diff --git a/osm_ro/vim_thread.py b/osm_ro/vim_thread.py index 8ed570cd..455c625b 100644 --- a/osm_ro/vim_thread.py +++ b/osm_ro/vim_thread.py @@ -63,7 +63,7 @@ The task content is (M: stored at memory, D: stored at database): vim_status: VIM status of the element. Stored also at database in the instance_XXX vim_info: Detailed information of a vm/net from the VIM. Stored at database in the instance_XXX but not at vim_wim_actions - M depends: dict with task_index(from depends_on) to vim_id + M depends: dict with task_index(from depends_on) to dependency task M params: same as extra[params] MD error_msg: descriptive text upon an error.Stored also at database instance_XXX MD created_at: task creation time. The task of creation must be the oldest @@ -86,6 +86,8 @@ import vimconn_aws import vimconn_opennebula import vimconn_openstack import vimconn_vmware +import vimconn_fos +import vimconn_azure import yaml from db_base import db_base_Exception from lib_osm_openvim.ovim import ovimException @@ -100,6 +102,8 @@ vim_module = { "opennebula": vimconn_opennebula, "openstack": vimconn_openstack, "vmware": vimconn_vmware, + "fos": vimconn_fos, + "azure": vimconn_azure, } @@ -532,9 +536,8 @@ class vim_thread(threading.Thread): task_dependency["instance_action_id"], task_dependency["task_index"], task_dependency["action"], task_dependency["item"], task_dependency.get("error_msg"))) - task["depends"]["TASK-"+str(task_index)] = task_dependency["vim_id"] - task["depends"]["TASK-{}.{}".format(task["instance_action_id"], task_index)] =\ - task_dependency["vim_id"] + task["depends"]["TASK-"+str(task_index)] = task_dependency + task["depends"]["TASK-{}.{}".format(task["instance_action_id"], task_index)] = task_dependency if dependency_not_completed: # Move this task to the time dependency is going to be modified plus 10 seconds. self.db.update_rows("vim_wim_actions", modified_time=dependency_modified_at + 10, @@ -808,7 +811,7 @@ class vim_thread(threading.Thread): net_list = params[5] for net in net_list: if "net_id" in net and is_task_id(net["net_id"]): # change task_id into network_id - network_id = task["depends"][net["net_id"]] + network_id = task["depends"][net["net_id"]].get("vim_id") if not network_id: raise VimThreadException( "Cannot create VM because depends on a network not created or found: " + @@ -1055,7 +1058,8 @@ class vim_thread(threading.Thread): dep_id = "TASK-" + str(task["extra"]["depends_on"][0]) task_id = task["instance_action_id"] + "." + str(task["task_index"]) error_text = "" - interfaces = task.get("depends").get(dep_id).get("extra").get("interfaces") + interfaces = task["depends"][dep_id]["extra"].get("interfaces") + ingress_interface_id = task.get("extra").get("params").get("ingress_interface_id") egress_interface_id = task.get("extra").get("params").get("egress_interface_id") ingress_vim_interface_id = None