mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-03 19:16:10 +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):
|
def test_buckets(connection: S3Connection, client: S3ObjectStoreClient):
|
||||||
if connection.bucketNames:
|
if connection.bucketNames:
|
||||||
return partial(
|
for bucket_name in connection.bucketNames:
|
||||||
client.s3_client.list_objects, Bucket=connection.bucketNames[0]
|
client.s3_client.list_objects(Bucket=bucket_name)
|
||||||
)
|
return
|
||||||
return client.s3_client.list_buckets
|
client.s3_client.list_buckets()
|
||||||
|
|
||||||
test_fn = {
|
test_fn = {
|
||||||
"ListBuckets": test_buckets(service_connection, client),
|
"ListBuckets": partial(
|
||||||
|
test_buckets, client=client, connection=service_connection
|
||||||
|
),
|
||||||
"GetMetrics": partial(
|
"GetMetrics": partial(
|
||||||
client.cloudwatch_client.list_metrics, Namespace="AWS/S3"
|
client.cloudwatch_client.list_metrics, Namespace="AWS/S3"
|
||||||
),
|
),
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user