tempest/services/image/v1/json/image_client.py
def wait_for_image_status(self, image_id, status):
        """Waits for a Image to reach a given status."""
        start_time = time.time()
        old_value = value = self._get_image_status(image_id)
        while True:
            dtime = time.time() - start_time
            time.sleep(self.build_interval)
            if value != old_value:
                LOG.info('Value transition from "%s" to "%s"'
                         'in %d second(s).', old_value,
                         value, dtime)
            if value == status:
                return value

            if value == 'killed':
                raise exceptions.ImageKilledException(image_id=image_id,
                                                      status=status)
            if dtime > self.build_timeout:
                message = ('Time Limit Exceeded! (%ds)'
                           'while waiting for %s, '
                           'but we got %s.' %
                           (self.build_timeout, status, value))
                raise exceptions.TimeoutException(message)
            time.sleep(self.build_interval)
            old_value = value
            value = self._get_image_status(image_id)
Waits for a Image to reach a given status.
Waits for a Image to reach a given status.
Waits for a Image to reach a given status .
def wait_for_image_status(self, image_id, status):
        start_time = time.time()
        old_value = value = self._get_image_status(image_id)
        while True:
            dtime = time.time() - start_time
            time.sleep(self.build_interval)
            if value != old_value:
                LOG.info('Value transition from "%s" to "%s"'
                         'in %d second(s).', old_value,
                         value, dtime)
            if value == status:
                return value
            if value == 'killed':
                raise exceptions.ImageKilledException(image_id=image_id,
                                                      status=status)
            if dtime > self.build_timeout:
                message = ('Time Limit Exceeded! (%ds)'
                           'while waiting for %s, '
                           'but we got %s.' %
                           (self.build_timeout, status, value))
                raise exceptions.TimeoutException(message)
            time.sleep(self.build_interval)
            old_value = value
            value = self._get_image_status(image_id)
def wait_for_image_status ( self , image_id , status ) : start_time = time . time ( ) old_value = value = self . _get_image_status ( image_id ) while True : dtime = time . time ( ) - start_time time . sleep ( self . build_interval ) if value != old_value : LOG . info ( 'Value transition from "%s" to "%s"' 'in %d second(s).' , old_value , value , dtime ) if value == status : return value if value == 'killed' : raise exceptions . ImageKilledException ( image_id = image_id , status = status ) if dtime > self . build_timeout : message = ( 'Time Limit Exceeded! (%ds)' 'while waiting for %s, ' 'but we got %s.' % ( self . build_timeout , status , value ) ) raise exceptions . TimeoutException ( message ) time . sleep ( self . build_interval ) old_value = value value = self . _get_image_status ( image_id )
Waits for a Image to reach a given status.
Waits for a Image to reach a given status .
"""Waits for a Image to reach a given status."""
self
image_id
status