utils.py 文件源码

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

项目:zun 作者: openstack 项目源码 文件源码
def get_resource(resource, resource_ident):
    """Get the resource from the uuid or logical name.

    :param resource: the resource type.
    :param resource_ident: the UUID or logical name of the resource.

    :returns: The resource.
    """
    resource = getattr(objects, resource)

    if uuidutils.is_uuid_like(resource_ident):
        return resource.get_by_uuid(pecan.request.context, resource_ident)

    return resource.get_by_name(pecan.request.context, resource_ident)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号