class VolumeSizeExceedsAvailableQuota(QuotaError):
- message = _("Requested volume or snapshot exceeds "
- "allowed Gigabytes quota")
+ message = _("Requested volume or snapshot exceeds allowed Gigabytes "
+ "quota. Requested %(requested)sG, quota is %(quota)sG and "
+ "%(consumed)sG has been consumed.")
class VolumeLimitExceeded(QuotaError):
def fake_backup_api_restore_throwing_VolumeSizeExceedsAvailableQuota(
cls, context, backup_id, volume_id):
- raise exception.VolumeSizeExceedsAvailableQuota()
+ raise exception.VolumeSizeExceedsAvailableQuota(requested='2',
+ consumed='2',
+ quota='3')
self.stubs.Set(
cinder.backup.API,
self.assertEqual(res_dict['overLimit']['code'], 413)
self.assertEqual(res_dict['overLimit']['message'],
'Requested volume or snapshot exceeds allowed '
- 'Gigabytes quota')
+ 'Gigabytes quota. Requested 2G, quota is 3G and '
+ '2G has been consumed.')
def test_restore_backup_with_VolumeLimitExceeded(self):
def fake_transfer_api_accept_throwing_VolumeSizeExceedsAvailableQuota(
cls, context, transfer, volume_id):
- raise exception.VolumeSizeExceedsAvailableQuota()
+ raise exception.VolumeSizeExceedsAvailableQuota(requested='2',
+ consumed='2',
+ quota='3')
self.stubs.Set(
cinder.transfer.API,
self.assertEqual(res_dict['overLimit']['code'], 413)
self.assertEqual(res_dict['overLimit']['message'],
'Requested volume or snapshot exceeds allowed '
- 'Gigabytes quota')
+ 'Gigabytes quota. Requested 2G, quota is 3G and '
+ '2G has been consumed.')
def test_accept_transfer_with_VolumeLimitExceeded(self):
's_size': vol_ref['size'],
'd_consumed': _consumed('gigabytes'),
'd_quota': quotas['gigabytes']})
- raise exception.VolumeSizeExceedsAvailableQuota()
+ raise exception.VolumeSizeExceedsAvailableQuota(
+ requested=vol_ref['size'],
+ consumed=_consumed('gigabytes'),
+ quota=quotas['gigabytes'])
elif 'volumes' in overs:
msg = _("Quota exceeded for %(s_pid)s, tried to create "
"volume (%(d_consumed)d volumes "
'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 "
's_size': size,
'd_consumed': _consumed('gigabytes'),
'd_quota': quotas['gigabytes']})
- raise exception.VolumeSizeExceedsAvailableQuota()
+ raise exception.VolumeSizeExceedsAvailableQuota(
+ requested=size,
+ consumed=_consumed('gigabytes'),
+ quota=quotas['gigabytes'])
elif _is_over('volumes'):
msg = _("Quota exceeded for %(s_pid)s, tried to create "
"volume (%(d_consumed)d volumes "