The query built to retrieve glance metadata associated to a volume
was sub-optimal: all rows of volume_glance_metadata were returned.
Fix it by properly joining the 2 tables with volume_id field.
Closes-bug: #
1349936
Change-Id: Ic09414de769e71f8b8f99113838af48d8520e187
models.VolumeGlanceMetadata,
session=session)
if is_user_context(context):
- query = query.filter(models.Volume.project_id == context.project_id)
+ query = query.filter(
+ models.Volume.id == models.VolumeGlanceMetadata.volume_id,
+ models.Volume.project_id == context.project_id)
return query.all()