Fix swagger pep error 11/74711/1
authorHaibin Huang <haibin.huang@intel.com>
Mon, 17 Dec 2018 12:04:42 +0000 (20:04 +0800)
committerHaibin Huang <haibin.huang@intel.com>
Mon, 17 Dec 2018 12:04:42 +0000 (20:04 +0800)
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>
pike/pike/swagger/__init__.py
pike/pike/swagger/tests.py
pike/pike/swagger/urls.py
pike/pike/swagger/views.py

index afa702d..ae1ce9d 100644 (file)
@@ -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.
-
index fe1b81c..cb90d69 100644 (file)
@@ -13,7 +13,6 @@
 # limitations under the License.
 
 import unittest
-import json
 from django.test import Client
 from rest_framework import status
 
index 60771f4..5e0c023 100644 (file)
@@ -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
index 92c6a70..07c6960 100644 (file)
 # 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)