Преглед на файлове

HUE-5851 [fb] Support the new S3 regions

Enrico Berti преди 8 години
родител
ревизия
80e9ea5
променени са 2 файла, в които са добавени 15 реда и са изтрити 6 реда
  1. 11 4
      desktop/core/ext-py/boto-2.42.0/boto/s3/connection.py
  2. 4 2
      desktop/libs/aws/src/aws/s3/s3fs.py

+ 11 - 4
desktop/core/ext-py/boto-2.42.0/boto/s3/connection.py

@@ -137,16 +137,23 @@ class ProtocolIndependentOrdinaryCallingFormat(OrdinaryCallingFormat):
 
 class Location(object):
 
-    DEFAULT = ''  # US Classic Region
-    EU = 'EU'  # Ireland
-    EUCentral1 = 'eu-central-1'  # Frankfurt
+    # http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region
+    DEFAULT = ''
+    EU = 'EU'
+    EUCentral = 'eu-central-1'
+    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'
-    CNNorth1 = 'cn-north-1'
+    APSouth = 'ap-south-1'
 
 
 class NoHostProvided(object):

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

@@ -137,8 +137,10 @@ class S3FileSystem(object):
         raise S3FileSystemException(e.message or e.reason)
 
   def _get_location(self):
-    if get_default_region() in (Location.EU, Location.EUCentral1, Location.USWest, Location.USWest2, Location.SAEast,
-                                Location.APNortheast, Location.APSoutheast, Location.APSoutheast2, Location.CNNorth1):
+    if get_default_region() in (Location.EU, Location.EUCentral, 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):
       return get_default_region()
     else:
       return Location.DEFAULT