Add False check when do _retype_error

Do a false check when the reservations is None or en empty list.

Change-Id: I6d9be5254f301fa5a684143b86b15a196d9c4a97
This commit is contained in:
yenai 2018-08-02 13:56:17 +08:00
parent 08e41b6e2a
commit f3daa36d58
1 changed files with 4 additions and 2 deletions

View File

@ -2684,8 +2684,10 @@ class VolumeManager(manager.CleanableManager,
volume.update(status_update)
volume.save()
finally:
QUOTAS.rollback(context, old_reservations)
QUOTAS.rollback(context, new_reservations)
if old_reservations:
QUOTAS.rollback(context, old_reservations)
if new_reservations:
QUOTAS.rollback(context, new_reservations)
status_update = {'status': volume.previous_status}
if context.project_id != volume.project_id: