Browse Source

Merge "Improve error log when snapshot fails" into stable/train

changes/16/787316/1
Zuul 4 weeks ago
committed by Gerrit Code Review
parent
commit
366f938ac5
3 changed files with 12 additions and 0 deletions
  1. +5
    -0
      nova/exception.py
  2. +2
    -0
      nova/image/glance.py
  3. +5
    -0
      nova/tests/unit/image/test_glance.py

+ 5
- 0
nova/exception.py View File

@ -620,6 +620,11 @@ class ImageBadRequest(Invalid):
"%(response)s")
class ImageQuotaExceeded(NovaException):
msg_fmt = _("Quota exceeded or out of space for image %(image_id)s "
"in the image service.")
class InstanceUnacceptable(Invalid):
msg_fmt = _("Instance %(instance_id)s is unacceptable: %(reason)s")


+ 2
- 0
nova/image/glance.py View File

@ -938,6 +938,8 @@ def _translate_image_exception(image_id, exc_value):
if isinstance(exc_value, glanceclient.exc.BadRequest):
return exception.ImageBadRequest(image_id=image_id,
response=six.text_type(exc_value))
if isinstance(exc_value, glanceclient.exc.HTTPOverLimit):
return exception.ImageQuotaExceeded(image_id=image_id)
return exc_value


+ 5
- 0
nova/tests/unit/image/test_glance.py View File

@ -305,6 +305,11 @@ class TestExceptionTranslations(test.NoDBTestCase):
out_exc = glance._translate_image_exception('123', in_exc)
self.assertIsInstance(out_exc, exception.ImageNotFound)
def test_client_httpoverlimit_converts_to_imagequotaexceeded(self):
in_exc = glanceclient.exc.HTTPOverLimit('123')
out_exc = glance._translate_image_exception('123', in_exc)
self.assertIsInstance(out_exc, exception.ImageQuotaExceeded)
class TestGlanceSerializer(test.NoDBTestCase):
def test_serialize(self):


Loading…
Cancel
Save