Skip to content

Commit

Permalink
Return host when get s3 container name
Browse files Browse the repository at this point in the history
  • Loading branch information
杨赫然 committed Nov 18, 2024
1 parent 67595fa commit 5ac24c0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion seafobj/backends/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ def __init__(self, compressed, s3_conf, crypto=None, cache=None):
AbstractObjStore.__init__(self, compressed, crypto, cache)
self.s3_client = SeafS3Client(s3_conf)
self.bucket_name = s3_conf.bucket_name
if s3_conf.host:
self.domain = s3_conf.host
else:
self.domain = "s3." + s3_conf.aws_region + ".amazonaws.com"

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

def get_container_name(self):
return self.bucket_name
return self.domain + "/" + self.bucket_name

0 comments on commit 5ac24c0

Please sign in to comment.