From: Brian Waldon Date: Mon, 22 Oct 2012 21:37:26 +0000 (-0700) Subject: Drop unused quota_usage db methods X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=5ddcf35d6889464182173c0524801d20d807e3b6;p=openstack-build%2Fcinder-build.git Drop unused quota_usage db methods The quota_usage_update and quota_usage_destroy db methods are not used anywhere - drop them. Change-Id: Iaa23d1de1642ac7ec9ab4b4cbe119ec742346505 --- diff --git a/cinder/db/api.py b/cinder/db/api.py index 120dad789..7ac9acffa 100644 --- a/cinder/db/api.py +++ b/cinder/db/api.py @@ -541,18 +541,6 @@ def quota_usage_get_all_by_project(context, project_id): return IMPL.quota_usage_get_all_by_project(context, project_id) -def quota_usage_update(context, class_name, resource, in_use, reserved, - until_refresh): - """Update a quota usage or raise if it does not exist.""" - return IMPL.quota_usage_update(context, project_id, resource, - in_use, reserved, until_refresh) - - -def quota_usage_destroy(context, project_id, resource): - """Destroy the quota usage or raise if it does not exist.""" - return IMPL.quota_usage_destroy(context, project_id, resource) - - ################### diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index 1e75b2978..aa428aa07 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -566,35 +566,6 @@ def quota_usage_create(context, project_id, resource, in_use, reserved, return quota_usage_ref -@require_admin_context -def quota_usage_update(context, project_id, resource, in_use, reserved, - until_refresh, session=None): - def do_update(session): - quota_usage_ref = quota_usage_get(context, project_id, resource, - session=session) - quota_usage_ref.in_use = in_use - quota_usage_ref.reserved = reserved - quota_usage_ref.until_refresh = until_refresh - quota_usage_ref.save(session=session) - - if session: - # Assume caller started a transaction - do_update(session) - else: - session = get_session() - with session.begin(): - do_update(session) - - -@require_admin_context -def quota_usage_destroy(context, project_id, resource): - session = get_session() - with session.begin(): - quota_usage_ref = quota_usage_get(context, project_id, resource, - session=session) - quota_usage_ref.delete(session=session) - - ###################