From: tierno Date: Fri, 10 Jul 2020 13:54:58 +0000 (+0000) Subject: fix 1137: SDN-assist issue connecting only one port X-Git-Tag: v8.0.0rc3~7 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F9388%2F2;p=osm%2FRO.git fix 1137: SDN-assist issue connecting only one port Change-Id: Id09e833ad425c5d1621b5a1e370a9ee389b4b5e7 Signed-off-by: tierno --- diff --git a/RO/osm_ro/vim_thread.py b/RO/osm_ro/vim_thread.py index 75ab8632..e7bf8914 100644 --- a/RO/osm_ro/vim_thread.py +++ b/RO/osm_ro/vim_thread.py @@ -1114,7 +1114,7 @@ class vim_thread(threading.Thread): connected_ports = task["extra"].get("connected_ports", []) new_connected_ports = [] last_update = task["extra"].get("last_update", 0) - sdn_status = "BUILD" + sdn_status = task["extra"].get("vim_status", "BUILD") sdn_info = None task_id = task["instance_action_id"] + "." + str(task["task_index"]) @@ -1212,18 +1212,21 @@ class vim_thread(threading.Thread): # if there are more ports to connect or they have been modified, call create/update try: - if (set(connected_ports) != set(new_connected_ports) or sdn_need_update) and len(sdn_ports) >= 2: + if set(connected_ports) != set(new_connected_ports) or sdn_need_update: last_update = time.time() if not wimconn_net_id: - if params[0] == "data": - net_type = "ELAN" - elif params[0] == "ptp": - net_type = "ELINE" + if len(sdn_ports) < 2: + if not pending_ports: + sdn_status = "ACTIVE" else: - net_type = "L3" - - wimconn_net_id, created_items = self.sdnconnector.create_connectivity_service( - net_type, sdn_ports) + if params[0] == "data": + net_type = "ELAN" + elif params[0] == "ptp": + net_type = "ELINE" + else: + net_type = "L3" + wimconn_net_id, created_items = self.sdnconnector.create_connectivity_service( + net_type, sdn_ports) else: created_items = self.sdnconnector.edit_connectivity_service( wimconn_net_id, conn_info=created_items, connection_points=sdn_ports)