summaryrefslogtreecommitdiff
path: root/swift/obj
diff options
context:
space:
mode:
Diffstat (limited to 'swift/obj')
-rw-r--r--swift/obj/ssync_receiver.py6
-rw-r--r--swift/obj/ssync_sender.py8
2 files changed, 8 insertions, 6 deletions
diff --git a/swift/obj/ssync_receiver.py b/swift/obj/ssync_receiver.py
index 1ee0713ff..fb125fca2 100644
--- a/swift/obj/ssync_receiver.py
+++ b/swift/obj/ssync_receiver.py
@@ -388,7 +388,8 @@ class Receiver(object):
raise SsyncClientDisconnected
if line.strip() != b':MISSING_CHECK: START':
raise Exception(
- 'Looking for :MISSING_CHECK: START got %r' % line[:1024])
+ 'Looking for :MISSING_CHECK: START got %r'
+ % utils.cap_length(line, 1024))
object_hashes = []
nlines = 0
while True:
@@ -450,7 +451,8 @@ class Receiver(object):
# Guess they hung up waiting for us to process the missing check
raise SsyncClientDisconnected
if line.strip() != b':UPDATES: START':
- raise Exception('Looking for :UPDATES: START got %r' % line[:1024])
+ raise Exception('Looking for :UPDATES: START got %r'
+ % utils.cap_length(line, 1024))
successes = 0
failures = 0
updates = 0
diff --git a/swift/obj/ssync_sender.py b/swift/obj/ssync_sender.py
index 296600a6a..b132b8b3d 100644
--- a/swift/obj/ssync_sender.py
+++ b/swift/obj/ssync_sender.py
@@ -266,7 +266,7 @@ class Sender(object):
self.daemon.node_timeout, 'connect receive'):
response = connection.getresponse()
if response.status != http.HTTP_OK:
- err_msg = response.read()[:1024]
+ err_msg = utils.cap_length(response.read(), 1024)
raise exceptions.ReplicationException(
'Expected status %s; got %s (%s)' %
(http.HTTP_OK, response.status, err_msg))
@@ -358,7 +358,7 @@ class Sender(object):
except UnicodeDecodeError:
pass
raise exceptions.ReplicationException(
- 'Unexpected response: %r' % line[:1024])
+ 'Unexpected response: %r' % utils.cap_length(line, 1024))
while True:
with exceptions.MessageTimeout(
self.daemon.http_timeout, 'missing_check line wait'):
@@ -447,7 +447,7 @@ class Sender(object):
except UnicodeDecodeError:
pass
raise exceptions.ReplicationException(
- 'Unexpected response: %r' % line[:1024])
+ 'Unexpected response: %r' % utils.cap_length(line, 1024))
while True:
with exceptions.MessageTimeout(
self.daemon.http_timeout, 'updates line wait'):
@@ -464,7 +464,7 @@ class Sender(object):
except UnicodeDecodeError:
pass
raise exceptions.ReplicationException(
- 'Unexpected response: %r' % line[:1024])
+ 'Unexpected response: %r' % utils.cap_length(line, 1024))
def send_subrequest(self, connection, method, url_path, headers, df):
msg = [b'%s %s' % (method.encode('ascii'), url_path.encode('utf8'))]