projects
/
osm
/
RO.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bug 793: fix detection of database not completely inited
[osm/RO.git]
/
osm_ro
/
vim_thread.py
diff --git
a/osm_ro/vim_thread.py
b/osm_ro/vim_thread.py
index
455c625
..
ffe721c
100644
(file)
--- a/
osm_ro/vim_thread.py
+++ b/
osm_ro/vim_thread.py
@@
-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 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:
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:
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,
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)
except db_base_Exception as e:
self.logger.error("task={} Error updating database {}".format(task_id, e), exc_info=True)