Merge "db: Migrate "volume", "volume attachment" APIs to enginefacade"

This commit is contained in:
Zuul 2022-05-18 05:30:17 +00:00 committed by Gerrit Code Review
commit 8f25145772
3 changed files with 762 additions and 526 deletions
cinder
db
api.py
sqlalchemy
tests/unit

View File

@ -514,11 +514,9 @@ def volume_attachment_get(context, attachment_id):
return IMPL.volume_attachment_get(context, attachment_id)
def volume_attachment_get_all_by_volume_id(context, volume_id,
session=None):
def volume_attachment_get_all_by_volume_id(context, volume_id):
return IMPL.volume_attachment_get_all_by_volume_id(context,
volume_id,
session)
volume_id)
def volume_attachment_get_all_by_host(context, host, filters=None):

File diff suppressed because it is too large Load Diff

View File

@ -2411,10 +2411,7 @@ class DBAPIVolumeTypeTestCase(BaseTest):
'extra_specs': vt_extra_specs})
volume_ref = db.volume_create(self.ctxt, {'volume_type_id': vt.id})
session = sqlalchemy_api.get_session()
volume = sqlalchemy_api._volume_get(self.ctxt, volume_ref.id,
session=session)
session.close()
volume = sqlalchemy_api._volume_get(self.ctxt, volume_ref.id)
actual_specs = {}
for spec in volume.volume_type.extra_specs: