tempest/services/orchestration/json/orchestration_client.py
def wait_for_resource_status(self, stack_identifier, resource_name,
                                 status, failure_pattern='^.*_FAILED$'):
        """Waits for a Resource to reach a given status."""
        start = int(time.time())
        fail_regexp = re.compile(failure_pattern)

        while True:
            try:
                resp, body = self.get_resource(
                    stack_identifier, resource_name)
            except exceptions.NotFound:
                # ignore this, as the resource may not have
                # been created yet
                pass
            else:
                resource_name = body['resource_name']
                resource_status = body['resource_status']
                if resource_status == status:
                    return
                if fail_regexp.search(resource_status):
                    raise exceptions.StackBuildErrorException(
                        stack_identifier=stack_identifier,
                        resource_status=resource_status,
                        resource_status_reason=body['resource_status_reason'])

            if int(time.time()) - start >= self.build_timeout:
                message = ('Resource %s failed to reach %s status within '
                           'the required time (%s s).' %
                           (resource_name, status, self.build_timeout))
                raise exceptions.TimeoutException(message)
            time.sleep(self.build_interval)
Waits for a Resource to reach a given status.
Waits for a Resource to reach a given status.
Waits for a Resource to reach a given status .
def wait_for_resource_status(self, stack_identifier, resource_name,
                                 status, failure_pattern='^.*_FAILED$'):
        start = int(time.time())
        fail_regexp = re.compile(failure_pattern)
        while True:
            try:
                resp, body = self.get_resource(
                    stack_identifier, resource_name)
            except exceptions.NotFound:
                pass
            else:
                resource_name = body['resource_name']
                resource_status = body['resource_status']
                if resource_status == status:
                    return
                if fail_regexp.search(resource_status):
                    raise exceptions.StackBuildErrorException(
                        stack_identifier=stack_identifier,
                        resource_status=resource_status,
                        resource_status_reason=body['resource_status_reason'])
            if int(time.time()) - start >= self.build_timeout:
                message = ('Resource %s failed to reach %s status within '
                           'the required time (%s s).' %
                           (resource_name, status, self.build_timeout))
                raise exceptions.TimeoutException(message)
            time.sleep(self.build_interval)
def wait_for_resource_status ( self , stack_identifier , resource_name , status , failure_pattern = '^.*_FAILED$' ) : start = int ( time . time ( ) ) fail_regexp = re . compile ( failure_pattern ) while True : try : resp , body = self . get_resource ( stack_identifier , resource_name ) except exceptions . NotFound : pass else : resource_name = body [ 'resource_name' ] resource_status = body [ 'resource_status' ] if resource_status == status : return if fail_regexp . search ( resource_status ) : raise exceptions . StackBuildErrorException ( stack_identifier = stack_identifier , resource_status = resource_status , resource_status_reason = body [ 'resource_status_reason' ] ) if int ( time . time ( ) ) - start >= self . build_timeout : message = ( 'Resource %s failed to reach %s status within ' 'the required time (%s s).' % ( resource_name , status , self . build_timeout ) ) raise exceptions . TimeoutException ( message ) time . sleep ( self . build_interval )
Waits for a Resource to reach a given status.
Waits for a Resource to reach a given status .
"""Waits for a Resource to reach a given status.""" # ignore this, as the resource may not have # been created yet
self
stack_identifier
resource_name
status
failure_pattern