(resource, resource_ident)
return resource.get_by_name(pecan.request.context, 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.
Get the resource from the uuid or logical name.
Get the resource from the uuid or logical name .
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)
def get_resource ( resource , resource_ident ) : 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 )