X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osm_ro%2Fvim_thread.py;h=ffe721c3c3969c25000a5293a8eb6a110fda843a;hb=refs%2Fchanges%2F85%2F7685%2F2;hp=d229fa196fc93f50ce9be0aaa8f6943d7a721e81;hpb=8dc9c8b71826f6939f453952bccdc0053712e7e0;p=osm%2FRO.git diff --git a/osm_ro/vim_thread.py b/osm_ro/vim_thread.py index d229fa19..ffe721c3 100644 --- a/osm_ro/vim_thread.py +++ b/osm_ro/vim_thread.py @@ -102,7 +102,7 @@ vim_module = { "opennebula": vimconn_opennebula, "openstack": vimconn_openstack, "vmware": vimconn_vmware, - "fos": vimconn_fos + "fos": vimconn_fos, "azure": vimconn_azure, } @@ -258,6 +258,7 @@ class vim_thread(threading.Thread): # task of creation must be the first in the list of related_task assert(related_tasks[0]["action"] in ("CREATE", "FIND")) + task["params"] = None if task["extra"]: extra = yaml.load(task["extra"]) else: @@ -707,9 +708,12 @@ class vim_thread(threading.Thread): UPDATE={("number_failed" if task["status"] == "FAILED" else "number_done"): {"INCREMENT": 1}}, WHERE={"uuid": task["instance_action_id"]}) if database_update: + where_filter = {"related": task["related"]} + if task["item"] == "instance_nets" and task["datacenter_vim_id"]: + where_filter["datacenter_tenant_id"] = task["datacenter_vim_id"] self.db.update_rows(table=task["item"], UPDATE=database_update, - WHERE={"related": task["related"]}) + WHERE=where_filter) except db_base_Exception as e: self.logger.error("task={} Error updating database {}".format(task_id, e), exc_info=True)