Merge pull request #1 from tsufiev/master
Add HTTPNotModified exception. Use raw_request for getting .tar.gz files...
This commit is contained in:
commit
5300203c88
@ -62,6 +62,10 @@ class HTTPMultipleChoices(HTTPException):
|
||||
self.details)
|
||||
|
||||
|
||||
class HTTPNotModified(HTTPException):
|
||||
code = 304
|
||||
|
||||
|
||||
class BadRequest(HTTPException):
|
||||
"""DEPRECATED!"""
|
||||
code = 400
|
||||
|
@ -235,7 +235,7 @@ class HTTPClient(object):
|
||||
elif resp.status in (301, 302, 305):
|
||||
# Redirected. Reissue the request to the new location.
|
||||
return self._http_request(resp['location'], method, **kwargs)
|
||||
elif resp.status == 300:
|
||||
elif resp.status in (300, 304):
|
||||
raise exc.from_response(resp)
|
||||
|
||||
return resp, body_iter
|
||||
@ -272,12 +272,6 @@ class HTTPClient(object):
|
||||
kwargs['headers']['Transfer-Encoding'] = 'chunked'
|
||||
return self._http_request(url, method, **kwargs)
|
||||
|
||||
def archive_request(self, method, url, **kwargs):
|
||||
kwargs.setdefault('headers', {})
|
||||
kwargs['headers'].setdefault('Content-Type',
|
||||
'application/x-tar')
|
||||
return self._http_request(url, method, **kwargs)
|
||||
|
||||
|
||||
class OpenSSLConnectionDelegator(object):
|
||||
"""
|
||||
|
@ -39,7 +39,7 @@ class Controller(object):
|
||||
|
||||
"""
|
||||
url = '/v1/client/ui'
|
||||
resp, body = self.http_client.archive_request('GET', url)
|
||||
resp, body = self.http_client.raw_request('GET', url)
|
||||
return body
|
||||
|
||||
def get_conductor_data(self):
|
||||
@ -48,5 +48,5 @@ class Controller(object):
|
||||
|
||||
"""
|
||||
url = '/v1/client/conductor'
|
||||
resp, body = self.http_client.archive_request('GET', url)
|
||||
resp, body = self.http_client.raw_request('GET', url)
|
||||
return body
|
Loading…
x
Reference in New Issue
Block a user