(resource='servers')
return resp
Return a 404 response body, depending on the resource.  Expects
    resource to be one of "images", "flavors", "loadbalancer", or "node".

    If the resource is unrecognized, defaults to
    "The resource culd not be found."
Return a 404 response body, depending on the resource.  Expects
    resource to be one of "images", "flavors", "loadbalancer", or "node".
Return a 404 response body depending on the resource . Expects resource to be one of images flavors loadbalancer or node .
def not_found_response(resource='servers'):
    """
    Return a 404 response body, depending on the resource.  Expects
    resource to be one of "images", "flavors", "loadbalancer", or "node".

    If the resource is unrecognized, defaults to
    "The resource culd not be found."
    """
    message = {
        'images': "Image not found.",
        'flavors': "The resource could not be found.",
        'loadbalancer': "Load balancer not found",
        'node': "Node not found"
    }
    resp = {
        "itemNotFound": {
            "message": message.get(resource, "The resource could not be found."),
            "code": 404
        }
    }
    if resource == 'loadbalancer' or resource == 'node':
        return resp["itemNotFound"]
    return resp
def not_found_response ( resource = 'servers' ) : message = { 'images' : "Image not found." , 'flavors' : "The resource could not be found." , 'loadbalancer' : "Load balancer not found" , 'node' : "Node not found" } resp = { "itemNotFound" : { "message" : message . get ( resource , "The resource could not be found." ) , "code" : 404 } } if resource == 'loadbalancer' or resource == 'node' : return resp [ "itemNotFound" ] return resp