add more detail to s3api test failure

Change-Id: I89d19c299cf67c459ee893cde7ed6f6716c04f9b
This commit is contained in:
Clay Gerrard 2019-04-02 07:06:09 -05:00
parent d016693875
commit 9d9f8b0ff2

View File

@ -16,8 +16,10 @@
import os import os
import test.functional as tf import test.functional as tf
from boto.s3.connection import S3Connection, OrdinaryCallingFormat, \ from boto.s3.connection import S3Connection, OrdinaryCallingFormat, \
BotoClientError, S3ResponseError S3ResponseError
import six import six
import sys
import traceback
RETRY_COUNT = 3 RETRY_COUNT = 3
@ -92,11 +94,12 @@ class Connection(object):
# 404 means NoSuchBucket, NoSuchKey, or NoSuchUpload # 404 means NoSuchBucket, NoSuchKey, or NoSuchUpload
if e.status != 404: if e.status != 404:
raise raise
except (BotoClientError, S3ResponseError) as e: except Exception as e:
exceptions.append(e) exceptions.append(''.join(
traceback.format_exception(*sys.exc_info())))
if exceptions: if exceptions:
# raise the first exception exceptions.insert(0, 'Too many errors to continue:')
raise exceptions.pop(0) raise Exception('\n========\n'.join(exceptions))
def make_request(self, method, bucket='', obj='', headers=None, body='', def make_request(self, method, bucket='', obj='', headers=None, body='',
query=None): query=None):