From: Babu Shanmugam Date: Wed, 19 Feb 2014 12:54:46 +0000 (+0000) Subject: In database delete Session.flush() has to be called appropriately, to avoid foreign... X-Git-Tag: v0.78~92^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=37e781739c44421389fc2b4e935ec74bb71870ce;p=ceph.git In database delete Session.flush() has to be called appropriately, to avoid foreign key conflicts in delete() request to the database Signed-off-by: Babu Shanmugam --- diff --git a/server/ceph_brag/model/db.py b/server/ceph_brag/model/db.py index 7f8adee5e3a6..974b37ce2550 100644 --- a/server/ceph_brag/model/db.py +++ b/server/ceph_brag/model/db.py @@ -166,7 +166,9 @@ def delete_uuid(uuid): Session.query(components_info).filter_by(vid=v.index).delete() Session.query(pools_info).filter_by(vid=v.index).delete() Session.query(osds_info).filter_by(vid=v.index).delete() + Session.flush() Session.delete(v) + Session.flush() Session.delete(ci) return None