From 6ec10cf3bd82f165d65413c269ad80493e9ae184 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Fri, 27 Nov 2015 14:12:06 -0600 Subject: [PATCH] Cleanup orphaned code in sqlalchemy API There were several methods in the sqlalchemy code that were no longer being used anywhere. While some of these have potential for being useful, they are not in use and should not be sitting around the codebase waiting for someone to need them. Change-Id: Ic30d27b29d19de5470c9fffadc136988899525ca --- cinder/db/sqlalchemy/api.py | 34 ---------------------------------- 1 file changed, 34 deletions(-) diff --git a/cinder/db/sqlalchemy/api.py b/cinder/db/sqlalchemy/api.py index d31f3aed3..96dfdb90f 100644 --- a/cinder/db/sqlalchemy/api.py +++ b/cinder/db/sqlalchemy/api.py @@ -396,19 +396,6 @@ def service_get_by_host_and_topic(context, host, topic): return result -@require_admin_context -def _service_get_all_topic_subquery(context, session, topic, subq, label): - sort_value = getattr(subq.c, label) - return model_query(context, models.Service, - func.coalesce(sort_value, 0), - session=session, read_deleted="no").\ - filter_by(topic=topic).\ - filter_by(disabled=False).\ - outerjoin((subq, models.Service.host == subq.c.host)).\ - order_by(sort_value).\ - all() - - @require_admin_context def service_get_by_args(context, host, binary): results = model_query(context, models.Service).\ @@ -1277,16 +1264,6 @@ def volume_destroy(context, volume_id): 'updated_at': literal_column('updated_at')}) -@require_admin_context -def volume_detach(context, attachment_id): - session = get_session() - with session.begin(): - volume_attachment_ref = volume_attachment_get(context, attachment_id, - session=session) - volume_attachment_ref['attach_status'] = 'detaching' - volume_attachment_ref.save(session=session) - - @require_admin_context def volume_detached(context, volume_id, attachment_id): """This updates a volume attachment and marks it as detached. @@ -1968,12 +1945,6 @@ def _volume_image_metadata_update(context, volume_id, metadata, delete, session=session) -@require_context -@require_volume_exists -def volume_metadata_get_item(context, volume_id, key): - return _volume_user_metadata_get_item(context, volume_id, key) - - @require_context @require_volume_exists def volume_metadata_get(context, volume_id): @@ -3785,11 +3756,6 @@ def _consistencygroup_data_get_for_project(context, project_id, return (0, result[0] or 0) -@require_admin_context -def consistencygroup_data_get_for_project(context, project_id): - return _consistencygroup_data_get_for_project(context, project_id) - - @require_context def _consistencygroup_get(context, consistencygroup_id, session=None): result = model_query(context, models.ConsistencyGroup, session=session, -- 2.45.2