aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorying.yunlong <ying.yunlong@zte.com.cn>2017-09-26 13:15:57 +0800
committeryunlong ying <ying.yunlong@zte.com.cn>2017-09-26 05:50:35 +0000
commit4e44bbcf4bca14060fb2c9ba704a16527e675c24 (patch)
tree4cadefffb5dbd2d30c63e9b30cc01e0aa7117eb3
parentd93dd62d48a6e8062a508c7252464afee800e8c4 (diff)
Fix vfc-catalog/swagger pep8 issue.
Change-Id: I8d1d641fa8e259b74b5cf109b67c61985525b0cc Issue-ID: VFC-456 Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
-rw-r--r--lcm/samples/views.py12
-rw-r--r--lcm/swagger/tests.py2
-rw-r--r--lcm/swagger/views.py12
3 files changed, 5 insertions, 21 deletions
diff --git a/lcm/samples/views.py b/lcm/samples/views.py
index 0e3c6acf..53153d0b 100644
--- a/lcm/samples/views.py
+++ b/lcm/samples/views.py
@@ -15,11 +15,9 @@
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)
-
-
-
-
diff --git a/lcm/swagger/tests.py b/lcm/swagger/tests.py
index 54551faf..4f2e6522 100644
--- a/lcm/swagger/tests.py
+++ b/lcm/swagger/tests.py
@@ -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
diff --git a/lcm/swagger/views.py b/lcm/swagger/views.py
index fdef8aed..5034905c 100644
--- a/lcm/swagger/views.py
+++ b/lcm/swagger/views.py
@@ -14,20 +14,16 @@
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)
-
-
-