diff options
author | Milo Casagrande <milo.casagrande@linaro.org> | 2014-07-31 17:15:36 +0200 |
---|---|---|
committer | Milo Casagrande <milo.casagrande@linaro.org> | 2014-07-31 17:15:36 +0200 |
commit | 027608ee954832a7613038c8c3dfffc4d89a3091 (patch) | |
tree | 83dce6ccaae28bdcf2d28490a7029263ff02e2f5 /app/handlers/boot.py | |
parent | a7ec51dd6fab4a036e7bfa05bf46a858241036a2 (diff) |
Massive refactoring.
* Will break the frontend.
* Rework BaseHandler in order for that to handle all the async
calls setup, and leave the subclasses to implement just the
correct methods.
* TokenHandler is a special case, since we need special token
protection for that.
* Fix db.py so that it returns plaun mongodb objects (Cursor)
and store them as is: they are iteratable.
* Make HandlerResponse the only accepted response type to
create the response that is sent to the clients.
* Fixe, rework and add tests.
Change-Id: Ief7dad65b2801f701e7e5f67b3a360329aca69f6
Diffstat (limited to 'app/handlers/boot.py')
-rw-r--r-- | app/handlers/boot.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/app/handlers/boot.py b/app/handlers/boot.py index f4c1152..0568638 100644 --- a/app/handlers/boot.py +++ b/app/handlers/boot.py @@ -16,6 +16,7 @@ """The RequestHandler for /boot URLs.""" from handlers.base import BaseHandler +from handlers.response import HandlerResponse from models import ( CREATED_KEY, DEFCONFIG_KEY, @@ -52,5 +53,10 @@ class BootHandler(BaseHandler): return valid_keys.get(method, None) def _post(self, json_obj): + response = HandlerResponse(202) + response.reason = "Request accepted and being imported" + response.result = None + import_boot.apply_async([json_obj]) - self._create_valid_response(200) + + return response |