Comment 2 for bug 1559401

Revision history for this message
junkao (junkao) wrote :

@Dmitry Klenov

* Exact command with parameters you used

fuel-createmirror -M

fuel-mirror create -G mos -I /usr/share/fuel-mirror/ubuntu.yaml --debug

fuel-mirror create -G ubuntu -I /usr/share/fuel-mirror/ubuntu.yaml --debug

* Which repositories did you want to mirror

Want to mirror mos

* Did you use proxy

no proxy

* Content of fuel-createmirror configuration folder (/etc/fuel-createmirror)

i can't find this folder in fuel 8.0 version

I can find the following directory

/usr/share/fuel-mirror/ubuntu.yaml
/usr/share/fuel-mirror/centos.yaml
/etc/fuel-mirror/config.yaml

======================

I think we need a function to process it when HTTP 302 redirect found

https://github.com/openstack/fuel-mirror/blob/stable/8.0/packetary/library/connections.py
def http_response(self, request, response):
        """Wraps response in a ResumableResponse.
        Checks that partial request completed successfully.
        :param request: the instance of RetryableRequest
        :param response: the response object
        :return: ResumableResponse if success otherwise same response
        """
        code, msg = response.getcode(), response.msg
        # the server should response partial content if range is specified

------------------>

         if code == 302:
              something....

<-----------------------

if request.offset > 0 and code != 206:
            raise RangeError(msg)

        if code >= 400:
            logger.error(
                "request failed: %s - %d(%s), retries left - %d.",
                request.get_full_url(), code, msg, request.retries_left - 1
            )
            if is_retryable_http_error(code) and request.retries_left > 0:
                time.sleep(request.get_retry_interval())
                request.retries_left -= 1
                response = self.parent.open(request)
            # pass response to next handler as is.
            return response

        logger.debug(
            "request completed: %s - %d (%s), duration - %d ms.",
            request.get_full_url(), response.getcode(), response.msg,
            int((time.time() - request.start_time) * 1000)
        )

        return ResumableResponse(request, response, self.parent)