S3Session.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:mongodb_consistent_backup 作者: Percona-Lab 项目源码 文件源码
def __init__(self, region, access_key, secret_key, bucket_name, secure=True, num_retries=5, socket_timeout=15):
        self.region         = region
        self.access_key     = access_key
        self.secret_key     = secret_key
        self.secure         = secure
        self.num_retries    = num_retries
        self.socket_timeout = socket_timeout

        # monkey patch for bucket_name with dots
        # https://github.com/boto/boto/issues/2836
        if self.secure and '.' in bucket_name:
            self.calling_format = OrdinaryCallingFormat()
        else:
            self.calling_format = SubdomainCallingFormat()

        for section in boto.config.sections():
            boto.config.remove_section(section)
        boto.config.add_section('Boto')
        boto.config.setbool('Boto', 'is_secure', self.secure)
        boto.config.set('Boto', 'http_socket_timeout', str(self.socket_timeout))
        boto.config.set('Boto', 'num_retries', str(self.num_retries))

        self._conn = None
        self.connect()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号