diff options
Diffstat (limited to 'ocata/ocata/swagger/views.py')
-rw-r--r-- | ocata/ocata/swagger/views.py | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/ocata/ocata/swagger/views.py b/ocata/ocata/swagger/views.py index 27ea3653..30536d7c 100644 --- a/ocata/ocata/swagger/views.py +++ b/ocata/ocata/swagger/views.py @@ -12,16 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -import json import logging -import os -import traceback -from rest_framework import status from rest_framework.response import Response -from rest_framework.views import APIView -from common.exceptions import VimDriverNewtonException from newton_base.swagger import views as newton_json_view logger = logging.getLogger(__name__) @@ -36,14 +30,15 @@ class SwaggerJsonView(newton_json_view.SwaggerJsonView): :return: ''' - resp = super(SwaggerJsonView,self).get(request) + resp = super(SwaggerJsonView, self).get(request) json_data = resp.data if resp else None if json_data: json_data["basePath"] = "/api/multicloud-ocata/v0/" json_data["info"]["title"] = "Service NBI of MultiCloud plugin for OpenStack Ocata" return Response(data=json_data, status=200) else: - return Response(data={'error':'internal error'}, status=500) + return Response(data={'error': 'internal error'}, status=500) + class APIv1SwaggerJsonView(newton_json_view.SwaggerJsonView): @@ -54,11 +49,11 @@ class APIv1SwaggerJsonView(newton_json_view.SwaggerJsonView): :return: ''' - resp = super(APIv1SwaggerJsonView,self).get(request) + resp = super(APIv1SwaggerJsonView, self).get(request) json_data = resp.data if resp else None if json_data: json_data["basePath"] = "/api/multicloud-ocata/v1/" json_data["info"]["title"] = "Service NBI v1 of MultiCloud plugin for Ocata" return Response(data=json_data, status=200) else: - return Response(data={'error':'internal error'}, status=500) + return Response(data={'error': 'internal error'}, status=500) |