From fa45020d632839ab8d0e2f231617395541315772 Mon Sep 17 00:00:00 2001 From: lloretgalleg Date: Thu, 16 Jan 2020 14:12:39 +0100 Subject: [PATCH] Corrected bug appears when a sdn controller that needs a plugin is created first time Change-Id: Ib5f414935f6a7799326c4055bef754b827d3dd6a Signed-off-by: lloretgalleg --- RO/osm_ro/nfvo.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/RO/osm_ro/nfvo.py b/RO/osm_ro/nfvo.py index 1e08a4fe..451b1caa 100644 --- a/RO/osm_ro/nfvo.py +++ b/RO/osm_ro/nfvo.py @@ -5758,6 +5758,12 @@ def sdn_controller_create(mydb, tenant_id, sdn_controller): try: wim_id = ovim.new_of_controller(sdn_controller) + # Load plugin if not previously loaded + controller_type = sdn_controller.get("type") + plugin_name = "rosdn_" + controller_type + if plugin_name not in plugins: + _load_plugin(plugin_name, type="sdn") + thread_name = get_non_used_vim_name(sdn_controller['name'], wim_id, wim_id, None) new_thread = vim_thread(task_lock, plugins, thread_name, wim_id, None, db=db) new_thread.start() -- 2.25.1