Skip to content

Commit 5ac24c0

Browse files
author
杨赫然
committed
Return host when get s3 container name
1 parent 67595fa commit 5ac24c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

seafobj/backends/s3.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ def __init__(self, compressed, s3_conf, crypto=None, cache=None):
1010
AbstractObjStore.__init__(self, compressed, crypto, cache)
1111
self.s3_client = SeafS3Client(s3_conf)
1212
self.bucket_name = s3_conf.bucket_name
13+
if s3_conf.host:
14+
self.domain = s3_conf.host
15+
else:
16+
self.domain = "s3." + s3_conf.aws_region + ".amazonaws.com"
1317

1418
def read_obj_raw(self, repo_id, version, obj_id):
1519
real_obj_id = '%s/%s' % (repo_id, obj_id)
@@ -44,4 +48,4 @@ def stat_raw(self, repo_id, obj_id):
4448
return self.s3_client.stat_obj(s3_path)
4549

4650
def get_container_name(self):
47-
return self.bucket_name
51+
return self.domain + "/" + self.bucket_name

0 commit comments

Comments
 (0)