|
|
|
@ -20,13 +20,10 @@ import json
|
|
|
|
|
import urllib
|
|
|
|
|
import asyncio
|
|
|
|
|
import aiohttp
|
|
|
|
|
import logging
|
|
|
|
|
import traceback
|
|
|
|
|
import jsonschema
|
|
|
|
|
import jsonschema.exceptions
|
|
|
|
|
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
from ..compute.error import NodeError, ImageMissingError
|
|
|
|
|
from ..controller.controller_error import ControllerError
|
|
|
|
|
from ..ubridge.ubridge_error import UbridgeError
|
|
|
|
@ -36,6 +33,10 @@ from ..crash_report import CrashReport
|
|
|
|
|
from ..config import Config
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import logging
|
|
|
|
|
log = logging.getLogger(__name__)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async def parse_request(request, input_schema, raw):
|
|
|
|
|
"""Parse body of request and raise HTTP errors in case of problems"""
|
|
|
|
|
|
|
|
|
@ -217,7 +218,7 @@ class Route(object):
|
|
|
|
|
response = Response(request=request, route=route)
|
|
|
|
|
response.set_status(409)
|
|
|
|
|
response.json({"message": str(e), "status": 409, "image": e.image, "exception": e.__class__.__name__})
|
|
|
|
|
except asyncio.futures.CancelledError:
|
|
|
|
|
except asyncio.CancelledError:
|
|
|
|
|
response = Response(request=request, route=route)
|
|
|
|
|
response.set_status(408)
|
|
|
|
|
response.json({"message": "Request canceled", "status": 408})
|
|
|
|
|