From b6055a05cd6a44b1d71bf1308acf43a9f9e7b051 Mon Sep 17 00:00:00 2001 From: liyingjun Date: Mon, 5 Aug 2013 15:20:27 +0800 Subject: [PATCH] Clean destroy for project quota * Destroy user quotas under the project when deleting project quota. * Fixes bug 1206479 Change-Id: Id8391a2f6c25974b990c4a95a6bc99d696cd1c98 --- nova/db/sqlalchemy/api.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index 6e89059c3..87b5015d5 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -3167,6 +3167,11 @@ def quota_destroy_all_by_project(context, project_id): filter_by(project_id=project_id).\ soft_delete(synchronize_session=False) + model_query(context, models.ProjectUserQuota, session=session, + read_deleted="no").\ + filter_by(project_id=project_id).\ + soft_delete(synchronize_session=False) + model_query(context, models.QuotaUsage, session=session, read_deleted="no").\ filter_by(project_id=project_id).\