storage.py 文件源码

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

项目:forseti-security 作者: GoogleCloudPlatform 项目源码 文件源码
def get_text_file(self, full_bucket_path):
        """Gets a text file object as a string.

        Args:
            full_bucket_path (str): The full path of the bucket object.

        Returns:
            str: The object's content as a string.

        Raises:
            HttpError: HttpError is raised if the call to the GCP storage API
                fails
        """
        bucket, object_name = get_bucket_and_path_from(full_bucket_path)
        try:
            return self.repository.objects.download(bucket, object_name)
        except errors.HttpError as e:
            LOGGER.error('Unable to download file: %s', e)
            raise
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号