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
@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 fuel-mirror/ centos. yaml mirror/ config. yaml
/usr/share/
/etc/fuel-
======= ======= ======= =
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 http_error( code) and request. retries_ left > 0:
time. sleep(request. get_retry_ interval( ))
request. retries_ left -= 1
response = self.parent. open(request)
)
if is_retryable_
# pass response to next handler as is.
return response
)
return ResumableRespon se(request, response, self.parent)