Merge "Make ssync_sender a better HTTP client"

This commit is contained in:
Jenkins 2015-07-08 01:00:27 +00:00 committed by Gerrit Code Review
commit 26af0aee3e
2 changed files with 4 additions and 0 deletions

View File

@ -143,6 +143,7 @@ class Sender(object):
self.daemon.node_timeout, 'connect receive'):
self.response = self.connection.getresponse()
if self.response.status != http.HTTP_OK:
self.response.read()
raise exceptions.ReplicationException(
'Expected status %s; got %s' %
(http.HTTP_OK, self.response.status))

View File

@ -80,6 +80,9 @@ class FakeResponse(object):
self.fp = StringIO.StringIO(
'%x\r\n%s\r\n0\r\n\r\n' % (len(chunk_body), chunk_body))
def read(self, *args, **kwargs):
return ''
def close(self):
self.close_called = True