Permalink
Browse files

* 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
  • Loading branch information...
1 parent db08664 commit 627aa5810470cf6b85c0910ee3a92a8609e34733 ludvigm committed May 20, 2010
Showing with 12 additions and 2 deletions.
  1. +5 −0 ChangeLog
  2. +6 −1 S3/S3.py
  3. +1 −1 s3cmd
View
@@ -1,5 +1,10 @@
2010-05-21 Michal Ludvig <mludvig@logix.net.nz>
+ * s3cmd, S3/S3.py: Added support for bucket locations
+ outside US/EU (i.e. us-west-1 and ap-southeast-1 as of now).
+
+2010-05-21 Michal Ludvig <mludvig@logix.net.nz>
+
* s3cmd, S3/S3.py, S3/Config.py: Added --reduced-redundancy
switch for Reduced Redundancy Storage.
View
@@ -205,8 +205,13 @@ def bucket_create(self, bucket, bucket_location = None):
headers = SortedDict(ignore_case = True)
body = ""
if bucket_location and bucket_location.strip().upper() != "US":
+ bucket_location = bucket_location.strip()
+ if bucket_location.upper() == "EU":
+ bucket_location = bucket_location.upper()
+ else:
+ bucket_location = bucket_location.lower()
body = "<CreateBucketConfiguration><LocationConstraint>"
- body += bucket_location.strip().upper()
+ body += bucket_location
body += "</LocationConstraint></CreateBucketConfiguration>"
debug("bucket_location: " + body)
self.check_bucket_name(bucket, dns_strict = True)
View
2 s3cmd
@@ -1596,7 +1596,7 @@ def main():
optparser.add_option( "--rinclude", dest="rinclude", action="append", metavar="REGEXP", help="Same as --include but uses REGEXP (regular expression) instead of GLOB")
optparser.add_option( "--rinclude-from", dest="rinclude_from", action="append", metavar="FILE", help="Read --rinclude REGEXPs from FILE")
- optparser.add_option( "--bucket-location", dest="bucket_location", help="Datacentre to create bucket in. Either EU or US (default)")
+ 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")
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]")
optparser.add_option( "--log-target-prefix", dest="log_target_prefix", help="Target prefix for access logs (S3 URI)")

0 comments on commit 627aa58

Please sign in to comment.