From: tierno Date: Wed, 22 Jul 2020 11:41:05 +0000 (+0000) Subject: fix 1168 ensure VIM plugin is loaded at instanatiate/delete X-Git-Tag: release-v9.0-start~20 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F9507%2F2;p=osm%2FRO.git fix 1168 ensure VIM plugin is loaded at instanatiate/delete Change-Id: Id4c8978466211f7d9f0365a285a8dc52b51ad2bc Signed-off-by: tierno --- diff --git a/RO/osm_ro/nfvo.py b/RO/osm_ro/nfvo.py index 829697cf..31809716 100644 --- a/RO/osm_ro/nfvo.py +++ b/RO/osm_ro/nfvo.py @@ -2971,6 +2971,7 @@ def unify_cloud_config(cloud_config_preserve, cloud_config): def get_vim_thread(mydb, tenant_id, datacenter_id_name=None, datacenter_tenant_id=None): + global plugins datacenter_id = None datacenter_name = None thread = None @@ -2990,7 +2991,7 @@ def get_vim_thread(mydb, tenant_id, datacenter_id_name=None, datacenter_tenant_i if datacenter_tenant_id: where_["dt.uuid"] = datacenter_tenant_id datacenters = mydb.get_rows( - SELECT=("dt.uuid as datacenter_tenant_id, d.name as datacenter_name",), + SELECT=("dt.uuid as datacenter_tenant_id, d.name as datacenter_name", "d.type as type"), FROM="datacenter_tenants as dt join tenants_datacenters as td on dt.uuid=td.datacenter_tenant_id " "join datacenters as d on d.uuid=dt.datacenter_id", WHERE=where_) @@ -3001,6 +3002,10 @@ def get_vim_thread(mydb, tenant_id, datacenter_id_name=None, datacenter_tenant_i datacenter_name = datacenters[0]["datacenter_name"] thread = vim_threads["running"].get(thread_id) if not thread: + datacenter_type = datacenters[0]["type"] + plugin_name = "rovim_" + datacenter_type + if plugin_name not in plugins: + _load_plugin(plugin_name, type="vim") thread_name = get_non_used_vim_name(datacenter_name, datacenter_id) thread = vim_thread(task_lock, plugins, thread_name, None, thread_id, db=mydb)