From 9e562e862378b70ba362a45e72944ead98f12e0a Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Wed, 21 Oct 2015 16:56:10 +0200 Subject: [PATCH] Handle old 'EU' location constraint for the eu-west-1 region (cf. http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) --- ncdu_s3/s3_directory_generator.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ncdu_s3/s3_directory_generator.py b/ncdu_s3/s3_directory_generator.py index 1a3a04c..ac19cc3 100644 --- a/ncdu_s3/s3_directory_generator.py +++ b/ncdu_s3/s3_directory_generator.py @@ -16,6 +16,10 @@ def __init__(self, s3_url): try: client = boto3.client('s3') region = client.get_bucket_location(Bucket=self.bucket_name)['LocationConstraint'] + if region == 'EU': + # for the eu-west-1 region, location constraint may either be 'EU' or 'eu-west-1' + # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region + region = 'eu-west-1' except: region=None