Merge "Fix quota error when deleting temporary volume"

This commit is contained in:
Zuul 2018-06-29 19:01:19 +00:00 committed by Gerrit Code Review
commit fef7e728b0
2 changed files with 13 additions and 4 deletions

View File

@ -763,11 +763,12 @@ class VolumeManager(manager.CleanableManager,
# To backup a snapshot or a 'in-use' volume, create a temp volume
# from the snapshot or in-use volume, and back it up.
# Get admin_metadata to detect temporary volume.
# Get admin_metadata (needs admin context) to detect temporary volume.
is_temp_vol = False
if volume.admin_metadata.get('temporary', 'False') == 'True':
is_temp_vol = True
LOG.info("Trying to delete temp volume: %s", volume.id)
with volume.obj_as_admin():
if volume.admin_metadata.get('temporary', 'False') == 'True':
is_temp_vol = True
LOG.info("Trying to delete temp volume: %s", volume.id)
# The status 'deleting' is not included, because it only applies to
# the source volume to be deleted after a migration. No quota

View File

@ -0,0 +1,8 @@
---
fixes:
- |
Fix a quota usage error triggered by a non-admin user backing up an
in-use volume. The forced backup uses a temporary volume, and quota
usage was incorrectly updated when the temporary volume was deleted
after the backup operation completed.
Fixes `bug 1778774 <https://bugs.launchpad.net/tripleo/+bug/1778774>`__.