diff options
author | 2018-12-17 20:04:42 +0800 | |
---|---|---|
committer | 2018-12-17 20:04:42 +0800 | |
commit | b5252ab8719999c9ff0548e9d6e8950dbd2c3ac3 (patch) | |
tree | 62d2cb8b15ec5fd5b0b44edd521191899a284fe8 /pike/pike | |
parent | 10f2cc866b3e782d0a7e8c1543001242688d7d9e (diff) |
Fix swagger pep error
This patch is only fixing the pep8 issues under the swagger folder
for pike release, which is only triggered by tox manually.
Change-Id: I8746bea273f08f19d3075bcd899c2f536a9263b8
Issue-ID: MULTICLOUD-428
Signed-off-by: Haibin Huang <haibin.huang@intel.com>
Diffstat (limited to 'pike/pike')
-rw-r--r-- | pike/pike/swagger/__init__.py | 1 | ||||
-rw-r--r-- | pike/pike/swagger/tests.py | 1 | ||||
-rw-r--r-- | pike/pike/swagger/urls.py | 2 | ||||
-rw-r--r-- | pike/pike/swagger/views.py | 15 |
4 files changed, 6 insertions, 13 deletions
diff --git a/pike/pike/swagger/__init__.py b/pike/pike/swagger/__init__.py index afa702d3..ae1ce9db 100644 --- a/pike/pike/swagger/__init__.py +++ b/pike/pike/swagger/__init__.py @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/pike/pike/swagger/tests.py b/pike/pike/swagger/tests.py index fe1b81c8..cb90d692 100644 --- a/pike/pike/swagger/tests.py +++ b/pike/pike/swagger/tests.py @@ -13,7 +13,6 @@ # limitations under the License. import unittest -import json from django.test import Client from rest_framework import status diff --git a/pike/pike/swagger/urls.py b/pike/pike/swagger/urls.py index 60771f42..5e0c0233 100644 --- a/pike/pike/swagger/urls.py +++ b/pike/pike/swagger/urls.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from django.conf.urls import patterns, url +from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns from pike.swagger.views import SwaggerJsonView diff --git a/pike/pike/swagger/views.py b/pike/pike/swagger/views.py index 92c6a700..07c6960f 100644 --- a/pike/pike/swagger/views.py +++ b/pike/pike/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-pike/v0/" json_data["info"]["title"] = "Service NBI of MultiCloud plugin for OpenStack Pike" 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-pike/v1/" json_data["info"]["title"] = "Service NBI v1 of MultiCloud plugin for Pike" return Response(data=json_data, status=200) else: - return Response(data={'error':'internal error'}, status=500) + return Response(data={'error': 'internal error'}, status=500) |