From 3b397770532d29a1be0694cc15095986982c997b Mon Sep 17 00:00:00 2001 From: Alex Gray Date: Fri, 18 May 2018 20:53:13 -0400 Subject: [PATCH] Do not hardcode the regions --- athumb/backends/s3boto.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/athumb/backends/s3boto.py b/athumb/backends/s3boto.py index b9265b1..29255e1 100644 --- a/athumb/backends/s3boto.py +++ b/athumb/backends/s3boto.py @@ -22,20 +22,13 @@ from boto.s3.connection import S3Connection from boto.exception import S3ResponseError from boto.s3.key import Key + import boto.ec2 except ImportError: raise ImproperlyConfigured( "Could not load boto's S3 bindings. Please install boto." ) -AWS_REGIONS = [ - 'eu-west-1', - 'us-east-1', - 'us-west-1', - 'us-west-2', - 'sa-east-1', - 'ap-northeast-1', - 'ap-southeast-1', -] +AWS_REGIONS = [r.name for r in boto.ec2.regions()] REGION_RE = re.compile(r's3-(.+).amazonaws.com')