Permalink
Browse files

* s3cmd, S3/S3.py, S3/Config.py: Allow access to upper-case

  named buckets again with --use-old-connect-method 
  (uses http://s3.amazonaws.com/bucket/object instead of
  http://bucket.s3.amazonaws.com/object)


git-svn-id: https://s3tools.svn.sourceforge.net/svnroot/s3tools/s3cmd/trunk@218 830e0280-6d2a-0410-9c65-932aecc39d9d
  • Loading branch information...
1 parent 4da602a commit a208e977cf9a8c64b037be70acc51dc8f34de3dd @mludvig mludvig committed Sep 1, 2008
Showing with 19 additions and 3 deletions.
  1. +7 −0 ChangeLog
  2. +5 −0 NEWS
  3. +1 −0 S3/Config.py
  4. +5 −3 S3/S3.py
  5. +1 −0 s3cmd
View
@@ -1,3 +1,10 @@
+2008-09-01 Michal Ludvig <michal@logix.cz>
+
+ * s3cmd, S3/S3.py, S3/Config.py: Allow access to upper-case
+ named buckets again with --use-old-connect-method
+ (uses http://s3.amazonaws.com/bucket/object instead of
+ http://bucket.s3.amazonaws.com/object)
+
2008-08-19 Michal Ludvig <michal@logix.cz>
* s3cmd: Always output UTF-8, even on output redirects.
View
5 NEWS
@@ -1,3 +1,8 @@
+s3cmd 0.9.9 - ???
+===========
+* Allow access to upper-case named buckets with
+ --use-old-connect-method parameter
+
s3cmd 0.9.8.3 - 2008-07-29
=============
* Bugfix release. Avoid running out-of-memory in MD5'ing
View
@@ -15,6 +15,7 @@ class Config(object):
secret_key = ""
host_base = "s3.amazonaws.com"
host_bucket = "%(bucket)s.s3.amazonaws.com"
+ use_old_connect_method = False
simpledb_host = "sdb.amazonaws.com"
verbosity = logging.WARNING
send_chunk = 4096
View
@@ -71,7 +71,7 @@ def get_connection(self, bucket):
return httplib.HTTPConnection(self.get_hostname(bucket))
def get_hostname(self, bucket):
- if bucket:
+ if bucket and not Config().use_old_connect_method:
if self.redir_map.has_key(bucket):
host = self.redir_map[bucket]
else:
@@ -85,10 +85,12 @@ def set_hostname(self, bucket, redir_hostname):
self.redir_map[bucket] = redir_hostname
def format_uri(self, resource):
- if self.config.proxy_host != "":
- uri = "http://%s%s" % (self.get_hostname(resource['bucket']), resource['uri'])
+ if resource['bucket'] and Config().use_old_connect_method:
+ uri = "/%s%s" % (resource['bucket'], resource['uri'])
else:
uri = resource['uri']
+ if self.config.proxy_host != "":
+ uri = "http://%s%s" % (self.get_hostname(resource['bucket']), uri)
debug('format_uri(): ' + uri)
return uri
View
1 s3cmd
@@ -898,6 +898,7 @@ def main():
optparser.add_option("-H", "--human-readable-sizes", dest="human_readable_sizes", action="store_true", help="Print sizes in human readable form.")
optparser.add_option("-v", "--verbose", dest="verbosity", action="store_const", const=logging.INFO, help="Enable verbose output.")
+ optparser.add_option( "--use-old-connect-method", dest="use_old_connect_method", action="store_true", help="Use deprecated method for connection to S3. Allows for upper-case bucket names but doesn't allow for buckets in Europe")
optparser.add_option("-d", "--debug", dest="verbosity", action="store_const", const=logging.DEBUG, help="Enable debug output.")
optparser.add_option( "--version", dest="show_version", action="store_true", help="Show s3cmd version (%s) and exit." % (PkgInfo.version))

0 comments on commit a208e97

Please sign in to comment.