Early die if on image gets killed
The Images reaches the 'killed' status only on an unrecoverable error, any further wait is in vain. The wait method will raise an exception on the killed state. Change-Id: I392674c872d7f2354a2a2d338e14630b211cf12b
This commit is contained in:
@ -81,6 +81,10 @@ class BuildErrorException(TempestException):
|
||||
message = "Server %(server_id)s failed to build and is in ERROR status"
|
||||
|
||||
|
||||
class ImageKilledException(TempestException):
|
||||
message = "Image %(image_id)s 'killed' while waiting for %(status)s"
|
||||
|
||||
|
||||
class AddImageException(TempestException):
|
||||
message = "Image %(image_id)s failed to become ACTIVE in the allotted time"
|
||||
|
||||
|
@ -265,9 +265,12 @@ class ImageClientJSON(RestClient):
|
||||
LOG.info('Value transition from "%s" to "%s"'
|
||||
'in %d second(s).', old_value,
|
||||
value, dtime)
|
||||
if (value == status):
|
||||
if value == status:
|
||||
return value
|
||||
|
||||
if value == 'killed':
|
||||
raise exceptions.ImageKilledException(image_id=image_id,
|
||||
status=value)
|
||||
if dtime > self.build_timeout:
|
||||
message = ('Time Limit Exceeded! (%ds)'
|
||||
'while waiting for %s, '
|
||||
|
Reference in New Issue
Block a user