X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FRO.git;a=blobdiff_plain;f=osm_ro%2Fvim_thread.py;h=7b197dac54858ac90fa2a6acb3a0641f8c3c0b41;hp=455c625b40aabd8c2faa99785e8322bb8f5833c2;hb=aaba400517bde3bfa47e28b315ef2b00e23acd06;hpb=5f65b78751e94ef54d9cd28d27b9d7a714e096e1 diff --git a/osm_ro/vim_thread.py b/osm_ro/vim_thread.py index 455c625b..7b197dac 100644 --- a/osm_ro/vim_thread.py +++ b/osm_ro/vim_thread.py @@ -707,9 +707,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)