riase correct exception if image prop not valid
we should raise nova exception so during build, nova
compute know it's a invalid image and stop retry
Change-Id: Id106d2c70fd12ffbd924ab20cd4022a3a9899f17
(cherry picked from commit b5831e1148
)
This commit is contained in:
parent
8d749b4831
commit
07bc90daf2
|
@ -4248,10 +4248,11 @@ class ZVMImageOPTestCases(ZVMTestCase):
|
|||
'os_name': 'name',
|
||||
'provisioning_method': 'method'}
|
||||
image_meta['id'] = '0'
|
||||
exc = self.assertRaises(exception.ZVMImageError,
|
||||
exc = self.assertRaises(nova_exception.ImageUnacceptable,
|
||||
self.imageop.zimage_check, image_meta)
|
||||
msg = ("Image error: The image 0 is not a valid zVM image, "
|
||||
"property ['image_type_xcat', 'os_version'] are missing")
|
||||
msg = ("Image 0 is unacceptable: The image 0 is not a valid zVM "
|
||||
"image, property ['image_type_xcat', 'os_version'] "
|
||||
"are missing")
|
||||
self.assertEqual(msg, six.text_type(exc))
|
||||
|
||||
|
||||
|
|
|
@ -752,7 +752,8 @@ class ZVMImages(object):
|
|||
"property %(prop)s are missing") % {'id': image_meta['id'],
|
||||
'prop': missing_prop})
|
||||
LOG.error(msg)
|
||||
raise exception.ZVMImageError(msg=msg)
|
||||
raise nova_exception.ImageUnacceptable(image_id=image_meta['id'],
|
||||
reason=msg)
|
||||
|
||||
def cleanup_image_after_migration(self, inst_name):
|
||||
"""Cleanup osimages in xCAT image repository while confirm migration
|
||||
|
|
Loading…
Reference in New Issue