image_service.py 文件源码

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

项目:bareon-ironic 作者: openstack 项目源码 文件源码
def get_image_unique_id(self, image_href):
        """Get unique ID of the resource.

        If possible, the ID should change if resource contents are changed.

        :param image_href: Image reference.
        :returns: Unique ID of the resource.
        """
        # NOTE(vdrok): Doing conversion of href in case it's unicode
        # string, UUID cannot be generated for unicode strings on python 2.
        return str(uuid.uuid5(uuid.NAMESPACE_URL,
                              image_href.encode('utf-8')))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号