Corrected bug appears when a sdn controller that needs a plugin is created first... 86/8486/1 v7.0.1rc2
authorlloretgalleg <illoret@indra.es>
Thu, 16 Jan 2020 13:12:39 +0000 (14:12 +0100)
committerlloretgalleg <illoret@indra.es>
Thu, 16 Jan 2020 13:12:39 +0000 (14:12 +0100)
Change-Id: Ib5f414935f6a7799326c4055bef754b827d3dd6a
Signed-off-by: lloretgalleg <illoret@indra.es>
RO/osm_ro/nfvo.py

index 1e08a4f..451b1ca 100644 (file)
@@ -5758,6 +5758,12 @@ def sdn_controller_create(mydb, tenant_id, sdn_controller):
     try:
         wim_id = ovim.new_of_controller(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()
         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()