Provide user with more information on quota fail
Provide the user with useful information when a snapshot or volume create fails because it would cause the user to exceed available quota. Specifically report the user's current gigabyte usage and quota allocations. Closes-Bug: #1235148 Change-Id: Ib4c5dbcbd172c69834c2824791af755380f38e01
This commit is contained in:
@@ -496,7 +496,10 @@ class API(base.Base):
|
||||
's_size': volume['size'],
|
||||
'd_consumed': _consumed(over),
|
||||
'd_quota': quotas[over]})
|
||||
raise exception.VolumeSizeExceedsAvailableQuota()
|
||||
raise exception.VolumeSizeExceedsAvailableQuota(
|
||||
requested=volume['size'],
|
||||
consumed=_consumed('gigabytes'),
|
||||
quota=quotas['gigabytes'])
|
||||
elif 'snapshots' in over:
|
||||
msg = _("Quota exceeded for %(s_pid)s, tried to create "
|
||||
"snapshot (%(d_consumed)d snapshots "
|
||||
|
||||
Reference in New Issue
Block a user