GitHub user ldipenti opened a pull request:
https://github.com/apache/libcloud/pull/1139
Retry-After header handling fixes
## Retry-After header handling fixes
### Description
* Pass response headers to exception_from_message() when receiving an error
response.
* Pass Retry-After header to BaseHTTPException, some other errors than 429
may include it. (Example: 503 Service Unavailable)
* Retry-After header may include an HTTP-date value, so check if that's the
case and if so, translate it to a delay seconds value.
* Added tests.
### Status
- done, ready for review
### Checklist (tick everything that applies)
- [X] [Code
linting](http://libcloud.readthedocs.org/en/latest/development.html#code-style-guide)
(required, can be done after the PR checks)
- [ ] Documentation
- [X] [Tests](http://libcloud.readthedocs.org/en/latest/testing.html)
- [X]
[ICLA](http://libcloud.readthedocs.org/en/latest/development.html#contributing-bigger-changes)
(required for bigger changes)
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/curoverse/libcloud retry-after-headers
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/libcloud/pull/1139.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1139
----
commit 9a2e7a180df359c9d0e4569d1d1642b782d01cf3
Author: Lucas Di Pentima <[email protected]>
Date: 2017-11-02T22:08:56Z
Pass response headers to exception_from_message() when receiving an
error response.
Pass Retry-After header to BaseHTTPException, some other errors than
429 may include it. (Example: 503 Service Unavailable)
Retry-After header may include an HTTP-date value, so check if that's
the case and if so, translate it to a delay seconds value.
Added tests.
----
---