s3.py 文件源码

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

项目:cloudaux 作者: Netflix-Skunkworks 项目源码 文件源码
def get_bucket_region(**kwargs):
    # Some s3 buckets do not allow viewing of details. We do not want to
    # throw an error in this case because we still want to see that the
    # bucket exists
    try:
        result = get_bucket_location(**kwargs)
        location = result['LocationConstraint']
    except ClientError as e:
        if 'AccessDenied' not in str(e):
            raise e
        return None

    if not location:
        return 'us-east-1'

    return S3_REGION_MAPPING.get(location, location)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号