def retry_request(self, method, action, body=None,<EOL>headers=None, params=None):
max_attempts = self.retries + <NUM_LIT:1><EOL>for i in range(max_attempts):<EOL><INDENT>try:<EOL><INDENT>return self.do_request(method, action, body=body,<EOL>headers=headers, params=params)<EOL><DEDENT>except exceptions.ConnectionFailed:<EOL><INDENT>if i < self.retries:<EOL><INDENT>_logger.debug('<STR_LIT>')<EOL>time.sleep(self.retry_interval)<EOL><DEDENT>elif self.raise_errors:<EOL><INDENT>raise<EOL><DEDENT><DEDENT><DEDENT>if self.retries:<EOL><INDENT>msg = (_("<STR_LIT>")<EOL>% max_attempts)<EOL><DEDENT>else:<EOL><INDENT>msg = _("<STR_LIT>")<EOL><DEDENT>raise exceptions.ConnectionFailed(reason=msg)<EOL>
Call do_request with the default retry configuration.

        Only idempotent requests should retry failed connection attempts.
        :raises: ConnectionFailed if the maximum # of retries is exceeded