Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions libcloud/storage/drivers/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
S3_EU_WEST2_HOST = "s3-eu-west-2.amazonaws.com"
S3_EU_CENTRAL_HOST = "s3-eu-central-1.amazonaws.com"
S3_EU_NORTH1_HOST = "s3-eu-north-1.amazonaws.com"
S3_EU_SOUTH1_HOST = 's3-eu-south-1.amazonaws.com'
S3_AP_SOUTH_HOST = "s3-ap-south-1.amazonaws.com"
S3_AP_SOUTHEAST_HOST = "s3-ap-southeast-1.amazonaws.com"
S3_AP_SOUTHEAST2_HOST = "s3-ap-southeast-2.amazonaws.com"
Expand All @@ -94,6 +95,7 @@
"eu-west-2": S3_EU_WEST2_HOST,
"eu-west-3": "s3.eu-west-3.amazonaws.com",
"eu-north-1": "s3.eu-north-1.amazonaws.com",
'eu-south-1': 's3.eu-south-1.amazonaws.com',
"eu-central-1": S3_EU_CENTRAL_HOST,
"ap-south-1": S3_AP_SOUTH_HOST,
"ap-southeast-1": S3_AP_SOUTHEAST_HOST,
Expand Down Expand Up @@ -1458,6 +1460,14 @@ class S3EUNorth1StorageDriver(S3StorageDriver):
ex_location_name = "eu-north-1"
region_name = "eu-north-1"

class S3EUSouth1Connection(S3SignatureV4Connection):
Copy link
Member

@Kami Kami Sep 13, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need anymore to define a class per region. A long time ago we moved away from a class per region to region constructor argument approach. Other classes were just left in places for backward compatibility reasons.

Just adding an entry to REGION_TO_HOST_MAP dictionary is sufficient.

Related comment on a similar PR - #1821 (comment).

if region and region not in REGION_TO_HOST_MAP.keys():

host = S3_EU_SOUTH1_HOST

class S3EUSouth1StorageDriver(S3StorageDriver):
name = 'Amazon S3 (eu-south-1)'
connectionCls = S3EUSouth1Connection
ex_location_name = 'eu-south-1'
region_name = 'eu-south-1'

class S3APSEStorageDriver(S3StorageDriver):
name = "Amazon S3 (ap-southeast-1)"
Expand Down