From c7f773b027019086153f0260b507c8fa173ee5e8 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Wed, 24 Jun 2020 10:05:22 +0200 Subject: Fix API serialization issues --- opendc/api/v2/experiments/experimentId/endpoint.py | 6 +++--- .../api/v2/experiments/experimentId/last-simulated-tick/endpoint.py | 2 +- opendc/api/v2/experiments/experimentId/machine-states/endpoint.py | 2 +- opendc/api/v2/experiments/experimentId/rack-states/endpoint.py | 2 +- opendc/api/v2/experiments/experimentId/room-states/endpoint.py | 2 +- .../experiments/experimentId/statistics/task-durations/endpoint.py | 2 +- opendc/api/v2/experiments/experimentId/task-states/endpoint.py | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'opendc/api/v2/experiments') diff --git a/opendc/api/v2/experiments/experimentId/endpoint.py b/opendc/api/v2/experiments/experimentId/endpoint.py index a306e441..4ae4abf2 100644 --- a/opendc/api/v2/experiments/experimentId/endpoint.py +++ b/opendc/api/v2/experiments/experimentId/endpoint.py @@ -10,7 +10,7 @@ def GET(request): request.check_required_parameters(path={'experimentId': 'int'}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment from the database @@ -49,7 +49,7 @@ def PUT(request): }}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment from the database @@ -92,7 +92,7 @@ def DELETE(request): request.check_required_parameters(path={'experimentId': 'int'}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment and make sure it exists diff --git a/opendc/api/v2/experiments/experimentId/last-simulated-tick/endpoint.py b/opendc/api/v2/experiments/experimentId/last-simulated-tick/endpoint.py index f96c90ff..554c03b5 100644 --- a/opendc/api/v2/experiments/experimentId/last-simulated-tick/endpoint.py +++ b/opendc/api/v2/experiments/experimentId/last-simulated-tick/endpoint.py @@ -12,7 +12,7 @@ def GET(request): request.check_required_parameters(path={'experimentId': 'int'}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment from the database diff --git a/opendc/api/v2/experiments/experimentId/machine-states/endpoint.py b/opendc/api/v2/experiments/experimentId/machine-states/endpoint.py index 5f586896..e903e691 100644 --- a/opendc/api/v2/experiments/experimentId/machine-states/endpoint.py +++ b/opendc/api/v2/experiments/experimentId/machine-states/endpoint.py @@ -13,7 +13,7 @@ def GET(request): request.check_required_parameters(path={'experimentId': 'int'}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment from the database diff --git a/opendc/api/v2/experiments/experimentId/rack-states/endpoint.py b/opendc/api/v2/experiments/experimentId/rack-states/endpoint.py index 54b2fd8a..a1841bf0 100644 --- a/opendc/api/v2/experiments/experimentId/rack-states/endpoint.py +++ b/opendc/api/v2/experiments/experimentId/rack-states/endpoint.py @@ -13,7 +13,7 @@ def GET(request): request.check_required_parameters(path={'experimentId': 'int'}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment from the database diff --git a/opendc/api/v2/experiments/experimentId/room-states/endpoint.py b/opendc/api/v2/experiments/experimentId/room-states/endpoint.py index 9b1e0a68..19ecec22 100644 --- a/opendc/api/v2/experiments/experimentId/room-states/endpoint.py +++ b/opendc/api/v2/experiments/experimentId/room-states/endpoint.py @@ -13,7 +13,7 @@ def GET(request): request.check_required_parameters(path={'experimentId': 'int'}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment from the database diff --git a/opendc/api/v2/experiments/experimentId/statistics/task-durations/endpoint.py b/opendc/api/v2/experiments/experimentId/statistics/task-durations/endpoint.py index fe62f7f6..6bc0d4bd 100644 --- a/opendc/api/v2/experiments/experimentId/statistics/task-durations/endpoint.py +++ b/opendc/api/v2/experiments/experimentId/statistics/task-durations/endpoint.py @@ -13,7 +13,7 @@ def GET(request): request.check_required_parameters(path={'experimentId': 'int'}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment from the database diff --git a/opendc/api/v2/experiments/experimentId/task-states/endpoint.py b/opendc/api/v2/experiments/experimentId/task-states/endpoint.py index 3f6ce4a7..b4d8a702 100644 --- a/opendc/api/v2/experiments/experimentId/task-states/endpoint.py +++ b/opendc/api/v2/experiments/experimentId/task-states/endpoint.py @@ -13,7 +13,7 @@ def GET(request): request.check_required_parameters(path={'experimentId': 'int'}) except exceptions.ParameterError as e: - return Response(400, e.message) + return Response(400, str(e)) # Instantiate an Experiment from the database -- cgit v1.2.3