Merge "Skip boto 2.x tests if boto is not installed"

This commit is contained in:
Zuul 2024-06-18 17:10:44 +00:00 committed by Gerrit Code Review
commit 839537f40e
2 changed files with 14 additions and 2 deletions

View File

@ -24,6 +24,10 @@ import os
import test.functional as tf
from test.functional.s3api.s3_test_client import (
Connection, get_boto3_conn, tear_down_s3)
try:
import boto
except ImportError:
boto = None
def setUpModule():
@ -52,6 +56,8 @@ class S3ApiBase(unittest.TestCase):
raise SkipTest('no s3api user configured')
if 's3api' not in tf.cluster_info:
raise SkipTest('s3api middleware is not enabled')
if boto is None:
raise SkipTest('boto 2.x library is not installed')
if tf.config.get('account'):
user_id = '%s:%s' % (tf.config['account'], tf.config['username'])
else:

View File

@ -19,8 +19,14 @@ from six.moves.urllib.parse import urlparse
import test.functional as tf
import boto3
from botocore.exceptions import ClientError
from boto.s3.connection import S3Connection, OrdinaryCallingFormat, \
S3ResponseError
try:
from boto.s3.connection import (
S3Connection,
OrdinaryCallingFormat,
S3ResponseError,
)
except ImportError:
S3Connection = OrdinaryCallingFormat = S3ResponseError = None
import six
import sys
import traceback