Hi there. I have been building some AMIs and found some restrictions which require me to create buckets in a particular region. On attempting to do this with s3cmd, I was getting an error back from S3 indicating that the region did not exist. It appears that the location constraint is case sensitive so I fixed up S3.py to not call upper() and updated the documentation for --bucket-location.
How do these diffs look to you to address this issue? --- s3cmd.old 2010-05-20 20:50:10.000000000 -0700 +++ s3cmd 2010-05-20 20:51:08.000000000 -0700 @@ -1504,7 +1504,7 @@ 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. Curent locations are EU or US (default)") + optparser.add_option( "--bucket-location", dest="bucket_location", help="Datacentre to create bucket in. Currently includes US (default), EU, us-west-1, and ap-southeast-1") optparser.add_option("-m", "--mime-type", dest="default_mime_type", type="mimetype", metavar="MIME/TYPE", help="Default MIME-type to be set for objects stored.") optparser.add_option("-M", "--guess-mime-type", dest="guess_mime_type", action="store_true", help="Guess MIME-type of files by their extension. Falls back to default MIME-Type as specified by --mime-type option") --- S3.py.old 2010-05-20 20:45:38.000000000 -0700 +++ S3.py 2010-05-20 20:57:01.000000000 -0700 @@ -200,9 +200,9 @@ def bucket_create(self, bucket, bucket_location = None): headers = SortedDict(ignore_case = True) body = "" - if bucket_location and bucket_location.strip().upper() != "US": + if bucket_location and bucket_location.strip() != "US": body = "<CreateBucketConfiguration><LocationConstraint>" - body += bucket_location.strip().upper() + body += bucket_location.strip() body += "</LocationConstraint></CreateBucketConfiguration>" debug("bucket_location: " + body) self.check_bucket_name(bucket, dns_strict = True) ------------------------------------------------------------------------------ _______________________________________________ S3tools-general mailing list S3tools-general@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/s3tools-general