(self, resource, base_path=None)
| 291 | S3Request.redir_map[bucket] = redir_hostname.lower() |
| 292 | |
| 293 | def format_uri(self, resource, base_path=None): |
| 294 | bucket_name = resource.get('bucket') |
| 295 | if bucket_name and ( |
| 296 | (bucket_name in S3Request.redir_map |
| 297 | and not S3Request.redir_map.get(bucket_name, '').startswith("%s."% bucket_name)) |
| 298 | or (bucket_name not in S3Request.redir_map |
| 299 | and not check_bucket_name_dns_support(self.config.host_bucket, bucket_name)) |
| 300 | ): |
| 301 | uri = "/%s%s" % (s3_quote(bucket_name, quote_backslashes=False, |
| 302 | unicode_output=True), |
| 303 | resource['uri']) |
| 304 | else: |
| 305 | uri = resource['uri'] |
| 306 | if base_path: |
| 307 | uri = "%s%s" % (base_path, uri) |
| 308 | if self.config.proxy_host != "" and not self.config.use_https: |
| 309 | uri = "http://%s%s" % (self.get_hostname(bucket_name), uri) |
| 310 | debug('format_uri(): ' + uri) |
| 311 | return uri |
| 312 | |
| 313 | ## Commands / Actions |
| 314 | def list_all_buckets(self): |
no test coverage detected