fix issue updating a vim network in a multisite deployment 11/7611/2
authortierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 5 Jun 2019 08:28:04 +0000 (08:28 +0000)
committertierno <alfonso.tiernosepulveda@telefonica.com>
Wed, 12 Jun 2019 10:36:10 +0000 (11:36 +0100)
Change-Id: I27bb7e49b3f97af0d2efdf0b839b3df2fad10f05
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
osm_ro/vim_thread.py

index 455c625..7b197da 100644 (file)
@@ -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)