Hi,
  With the new us-west-1 EC2 region came a new S3 location.
  The 'location' for us-west-1 is 'us-west-1'.  Previously, the mapping of
region:location was:
  - us-east-1:US (or 'Any')
  - eu-west-1:EU
  To that, we have to add:
  - us-west-1:us-west-1

   The current code will translate user input to uppper case, resulting in
US-WEST-1, which fails:
./s3cmd mb s3://abcdefghij-fooo --bucket-location us-west-1
ERROR: S3 error: 400 (InvalidLocationConstraint): The specified
location-constraint is not valid

It would seem logical that amazon will continue to use region==location.
This patch largely passes through whatever the user inputs unless they
give 'us' or 'eu'.

Index: S3/S3.py
===================================================================
--- S3/S3.py    (revision 401)
+++ S3/S3.py    (working copy)
@@ -201,8 +201,10 @@ class S3(object):
                headers = SortedDict(ignore_case = True)
                body = ""
                if bucket_location and bucket_location.strip().upper() != "US":
+                       loc = bucket_location.strip()
+                       if bucket_location.upper() == "EU": loc = "EU"
                        body  = 
"<CreateBucketConfiguration><LocationConstraint>"
-                       body += bucket_location.strip().upper()
+                       body += loc
                        body += 
"</LocationConstraint></CreateBucketConfiguration>"
                        debug("bucket_location: " + body)
                        self.check_bucket_name(bucket, dns_strict = True)

------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
S3tools-general mailing list
S3tools-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/s3tools-general

Reply via email to