]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Drop unused quota_usage db methods
authorBrian Waldon <bcwaldon@gmail.com>
Mon, 22 Oct 2012 21:37:26 +0000 (14:37 -0700)
committerBrian Waldon <bcwaldon@gmail.com>
Mon, 22 Oct 2012 21:37:51 +0000 (14:37 -0700)
The quota_usage_update and quota_usage_destroy db methods are
not used anywhere - drop them.

Change-Id: Iaa23d1de1642ac7ec9ab4b4cbe119ec742346505

cinder/db/api.py
cinder/db/sqlalchemy/api.py

index 120dad789cbb8a1250abb3fb92aec83b833ac96c..7ac9acffa13440db073e8fef0bc550c229516de5 100644 (file)
@@ -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)
-
-
 ###################
 
 
index 1e75b2978e166914c6326fd95e52ca6c2cc03bb9..aa428aa07d882be27a3d6ede139e11ea9235c4c7 100644 (file)
@@ -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)
-
-
 ###################