mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-11-30 17:44:16 +00:00
MINOR: improve s3 test connection (#16158)
This commit is contained in:
parent
1acf7d92d3
commit
5cae2137d3
@ -61,13 +61,15 @@ def test_connection(
|
||||
|
||||
def test_buckets(connection: S3Connection, client: S3ObjectStoreClient):
|
||||
if connection.bucketNames:
|
||||
return partial(
|
||||
client.s3_client.list_objects, Bucket=connection.bucketNames[0]
|
||||
)
|
||||
return client.s3_client.list_buckets
|
||||
for bucket_name in connection.bucketNames:
|
||||
client.s3_client.list_objects(Bucket=bucket_name)
|
||||
return
|
||||
client.s3_client.list_buckets()
|
||||
|
||||
test_fn = {
|
||||
"ListBuckets": test_buckets(service_connection, client),
|
||||
"ListBuckets": partial(
|
||||
test_buckets, client=client, connection=service_connection
|
||||
),
|
||||
"GetMetrics": partial(
|
||||
client.cloudwatch_client.list_metrics, Namespace="AWS/S3"
|
||||
),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user