From cfff09367301d3028ec445104dec6d831b229422 Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Mon, 28 Jun 2021 18:50:14 +0200 Subject: [PATCH] Update http_config.py Allow to query one config parameter --- cbpi/http_endpoints/http_config.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cbpi/http_endpoints/http_config.py b/cbpi/http_endpoints/http_config.py index 2379b64..5e233d2 100644 --- a/cbpi/http_endpoints/http_config.py +++ b/cbpi/http_endpoints/http_config.py @@ -2,7 +2,7 @@ from aiohttp import web from cbpi.api import * from cbpi.utils import json_dumps - +import logging class ConfigHttpEndpoints: @@ -58,7 +58,7 @@ class ConfigHttpEndpoints: """ return web.json_response(self.controller.cache, dumps=json_dumps) - @request_mapping(path="/{name}/", auth_required=False) + @request_mapping(path="/{name}/", method="POST", auth_required=False) async def http_paramter(self, request) -> web.Response: """ --- @@ -76,7 +76,7 @@ class ConfigHttpEndpoints: description: successful operation """ name = request.match_info['name'] - if name not in self.cache: - raise CBPiException("Parameter %s not found" % name) - - return web.json_response(self.cache.get(name), dumps=json_dumps) \ No newline at end of file +# if name not in self.cache: +# raise CBPiException("Parameter %s not found" % name) + data = self.controller.get(name) + return web.json_response(self.controller.get(name), dumps=json_dumps)