When a redirection response is received, s3cmd can get the hostname in the conneciton map correctly if bucket name dns support is not configured.
def get_hostname(self, bucket):
if bucket and check_bucket_name_dns_support(self.config.host_bucket, bucket):
if self.redir_map.has_key(bucket):
host = self.redir_map[bucket]
else:
host = getHostnameFromBucket(bucket)
else:
host = self.config.host_base
The bucket name dns support is not configured because we use path style access instead of virtual host style.
For example,
<error>
TemporaryRedirect
<message>Temporary Redirect</message>
<bucket>bucket1</bucket>
<endpoint>10.32.169.214:9020</endpoint>
</error>
INFO: bucket bucket1 Redirected to: 10.32.169.213:9020
INFO: bucket bucket1 Redirected to: 10.32.172.184:9020
INFO: bucket bucket1 Redirected to: 10.32.169.213:9020
INFO: bucket bucket1 Redirected to: 10.32.172.184:9020
INFO: bucket bucket1 Redirected to: 10.32.169.213:9020
Typo: should be "can NOT" get the hostname correctly.