Browse Source

HUE-6326 [aws] Add support for new S3 regions

Jenny Kim 8 years ago
parent
commit
9ba07ea

+ 8 - 0
desktop/core/ext-py/boto-2.46.1/boto/s3/connection.py

@@ -137,15 +137,23 @@ class ProtocolIndependentOrdinaryCallingFormat(OrdinaryCallingFormat):
 
 class Location(object):
 
+    # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
     DEFAULT = ''  # US Classic Region
     EU = 'EU'  # Ireland
     EUCentral1 = 'eu-central-1'  # Frankfurt
+    EUWest = 'eu-west-1'
+    EUWest2 = 'eu-west-2'
+    CACentral = 'ca-central-1'
+    USEast = 'us-east-1'
+    USEast2 = 'us-east-2'
     USWest = 'us-west-1'
     USWest2 = 'us-west-2'
     SAEast = 'sa-east-1'
     APNortheast = 'ap-northeast-1'
+    APNortheast2 = 'ap-northeast-2'
     APSoutheast = 'ap-southeast-1'
     APSoutheast2 = 'ap-southeast-2'
+    APSouth = 'ap-south-1'
     CNNorth1 = 'cn-north-1'
 
 

+ 3 - 2
desktop/libs/aws/src/aws/s3/s3fs.py

@@ -139,10 +139,11 @@ class S3FileSystem(object):
         raise S3FileSystemException(e.message or e.reason)
 
   def _get_location(self):
-    if get_default_region() in (Location.EU, Location.EUCentral, Location.EUWest, Location.EUWest2,
+
+    if get_default_region() in (Location.EU, Location.EUCentral1, Location.EUWest, Location.EUWest2,
                                 Location.CACentral, Location.USEast, Location.USEast2, Location.USWest,
                                 Location.USWest2, Location.SAEast, Location.APNortheast, Location.APNortheast2,
-                                Location.APSoutheast, Location.APSoutheast2, Location.APSouth):
+                                Location.APSoutheast, Location.APSoutheast2, Location.APSouth, Location.CNNorth1):
       return get_default_region()
     else:
       return Location.DEFAULT