Browse code

* s3cmd, S3/S3.py: Added support for bucket locations outside US/EU (i.e. us-west-1 and ap-southeast-1 as of now).

git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@412 830e0280-6d2a-0410-9c65-932aecc39d9d

Michal Ludvig authored on 2010/05/20 21:13:56
Showing 3 changed files
... ...
@@ -1,5 +1,10 @@
1 1
 2010-05-21  Michal Ludvig  <mludvig@logix.net.nz>
2 2
 
3
+	* s3cmd, S3/S3.py: Added support for bucket locations
4
+	  outside US/EU (i.e. us-west-1 and ap-southeast-1 as of now).
5
+
6
+2010-05-21  Michal Ludvig  <mludvig@logix.net.nz>
7
+
3 8
 	* s3cmd, S3/S3.py, S3/Config.py: Added --reduced-redundancy
4 9
 	  switch for Reduced Redundancy Storage.
5 10
 
... ...
@@ -205,8 +205,13 @@ class S3(object):
205 205
 		headers = SortedDict(ignore_case = True)
206 206
 		body = ""
207 207
 		if bucket_location and bucket_location.strip().upper() != "US":
208
+			bucket_location = bucket_location.strip()
209
+			if bucket_location.upper() == "EU":
210
+				bucket_location = bucket_location.upper()
211
+			else:
212
+				bucket_location = bucket_location.lower()
208 213
 			body  = "<CreateBucketConfiguration><LocationConstraint>"
209
-			body += bucket_location.strip().upper()
214
+			body += bucket_location
210 215
 			body += "</LocationConstraint></CreateBucketConfiguration>"
211 216
 			debug("bucket_location: " + body)
212 217
 			self.check_bucket_name(bucket, dns_strict = True)
... ...
@@ -1596,7 +1596,7 @@ def main():
1596 1596
 	optparser.add_option(      "--rinclude", dest="rinclude", action="append", metavar="REGEXP", help="Same as --include but uses REGEXP (regular expression) instead of GLOB")
1597 1597
 	optparser.add_option(      "--rinclude-from", dest="rinclude_from", action="append", metavar="FILE", help="Read --rinclude REGEXPs from FILE")
1598 1598
 
1599
-	optparser.add_option(      "--bucket-location", dest="bucket_location", help="Datacentre to create bucket in. Either EU or US (default)")
1599
+	optparser.add_option(      "--bucket-location", dest="bucket_location", help="Datacentre to create bucket in. As of now the datacenters are: US (default), EU, us-west-1, and ap-southeast-1")
1600 1600
 	optparser.add_option(      "--reduced-redundancy", "--rr", dest="reduced_redundancy", action="store_true", help="Store object with 'Reduced redundancy'. Lower per-GB price. [put, cp, mv]")
1601 1601
 
1602 1602
 	optparser.add_option(      "--log-target-prefix", dest="log_target_prefix", help="Target prefix for access logs (S3 URI)")