Fix vfc-catalog/swagger pep8 issue. 37/15337/2
authorying.yunlong <ying.yunlong@zte.com.cn>
Tue, 26 Sep 2017 05:15:57 +0000 (13:15 +0800)
committeryunlong ying <ying.yunlong@zte.com.cn>
Tue, 26 Sep 2017 05:50:35 +0000 (05:50 +0000)
Change-Id: I8d1d641fa8e259b74b5cf109b67c61985525b0cc
Issue-ID: VFC-456
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
lcm/samples/views.py
lcm/swagger/tests.py
lcm/swagger/views.py

index 0e3c6ac..53153d0 100644 (file)
 import logging
 import traceback
 
-from rest_framework.views import APIView
-from rest_framework.response import Response
 from rest_framework import status
-from lcm.pub.database import models
-
+from rest_framework.response import Response
+from rest_framework.views import APIView
 
 logger = logging.getLogger(__name__)
 
@@ -32,6 +30,7 @@ class SampleList(APIView):
         logger.debug("get")
         return Response({"status": "active"})
 
+
 class TablesList(APIView):
     def delete(self, request, modelName):
         logger.debug("Start delete model %s", modelName)
@@ -47,7 +46,6 @@ class TablesList(APIView):
                 status=status.HTTP_500_INTERNAL_SERVER_ERROR)
         return Response(data={}, status=status.HTTP_204_NO_CONTENT)
 
-
     def get(self, request, modelName):
         logger.debug("Get model %s", modelName)
         count = 0
@@ -59,7 +57,3 @@ class TablesList(APIView):
             return Response(data={"error": "failed"}, 
                 status=status.HTTP_500_INTERNAL_SERVER_ERROR)
         return Response(data={"count": count}, status=status.HTTP_200_OK)
-
-
-
-
index 54551fa..4f2e652 100644 (file)
@@ -10,7 +10,7 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
 import unittest
-import json
+
 from django.test import Client
 from rest_framework import status
 
index fdef8ae..5034905 100644 (file)
 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
 
-
 logger = logging.getLogger(__name__)
 
 
 class SwaggerJsonView(APIView):
 
     def get(self, request):
-
         json_file = os.path.join(os.path.dirname(__file__), 'vfc.nslcm.swagger.json')
         f = open(json_file)
         json_data = json.JSONDecoder().decode(f.read())
@@ -49,7 +45,6 @@ class SwaggerJsonView(APIView):
         json_data["paths"].update(json_data_temp["paths"])
         json_data["definitions"].update(json_data_temp["definitions"])
 
-
         json_file = os.path.join(os.path.dirname(__file__), 'vfc.sfclcm.swagger.json')
         f = open(json_file)
         json_data_temp = json.JSONDecoder().decode(f.read())
@@ -58,18 +53,13 @@ class SwaggerJsonView(APIView):
         json_data["paths"].update(json_data_temp["paths"])
         json_data["definitions"].update(json_data_temp["definitions"])
 
-
         json_file = os.path.join(os.path.dirname(__file__), 'vfc.others.swagger.json')
         f = open(json_file)
         json_data_temp = json.JSONDecoder().decode(f.read())
         f.close()
 
-        json_data_jobtemp=json_data["paths"]["/jobs/{jobId}"]
+        json_data_jobtemp = json_data["paths"]["/jobs/{jobId}"]
         json_data["paths"].update(json_data_temp["paths"])
         json_data["paths"]["/jobs/{jobId}"].update(json_data_jobtemp)
         json_data["definitions"].update(json_data_temp["definitions"])
-
         return Response(json_data)
-
-    
-