Modify vnfmgr code according to PEP8 standard 81/14081/1
authorying.yunlong <ying.yunlong@zte.com.cn>
Thu, 21 Sep 2017 05:29:17 +0000 (13:29 +0800)
committerying.yunlong <ying.yunlong@zte.com.cn>
Thu, 21 Sep 2017 05:29:17 +0000 (13:29 +0800)
Change-Id: I31393f8180e126d5628c917a2f447bb0b85a00e6
Issue-ID: VFC-408
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
12 files changed:
mgr/.gitreview
mgr/initialize.sh
mgr/mgr/pub/config/config.py
mgr/mgr/pub/database/models.py
mgr/mgr/samples/tests.py
mgr/mgr/samples/views.py
mgr/mgr/swagger/tests.py
mgr/mgr/swagger/urls.py
mgr/mgr/swagger/views.py
mgr/mgr/vnfreg/urls.py
mgr/mgr/vnfreg/views.py
mgr/mgr/wsgi.py

index 212b3df..9850d37 100644 (file)
@@ -1,4 +1,4 @@
 [gerrit]
 host=gerrit.onap.org
 port=29418
-project=vfc/gvnfm/vnfmgr
\ No newline at end of file
+project=vfc/gvnfm/vnfmgr
index 7ace382..3425019 100755 (executable)
@@ -12,4 +12,5 @@
 # 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.
+
 pip install -r requirements.txt
index 3e10230..542dbd8 100644 (file)
@@ -11,7 +11,6 @@
 # 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.
-import os
 
 # [MSB]
 MSB_SERVICE_IP = '127.0.0.1'
index 3c49353..0c9aa32 100644 (file)
@@ -11,6 +11,7 @@
 # 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.
+
 from django.db import models
 
 
@@ -23,5 +24,3 @@ class VnfRegModel(models.Model):
     port = models.CharField(db_column='PORT', max_length=200)
     username = models.CharField(db_column='USERNAME', max_length=255)
     password = models.CharField(db_column='PASSWORD', max_length=255)
-    
-
index 8f1c326..d2673d4 100644 (file)
@@ -30,6 +30,3 @@ class SampleViewTest(unittest.TestCase):
         self.assertEqual(status.HTTP_200_OK, response.status_code, response.content)
         resp_data = json.loads(response.content)
         self.assertEqual({"status": "active"}, resp_data)
-               
-       def test_url(self):
-           pass
index 828b182..5162f23 100644 (file)
@@ -21,9 +21,6 @@ logger = logging.getLogger(__name__)
 
 
 class SampleList(APIView):
-    """
-    List all samples.
-    """
     def get(self, request, format=None):
         logger.debug("get")
         return Response({"status": "active"})
index 3aed49b..4418b01 100644 (file)
@@ -13,7 +13,7 @@
 # limitations under the License.
 
 import unittest
-import json
+
 from django.test import Client
 from rest_framework import status
 
@@ -28,4 +28,3 @@ class SwaggerViewTest(unittest.TestCase):
     def test_sample(self):
         response = self.client.get("/api/vnfmgr/v1/swagger.json")
         self.assertEqual(status.HTTP_200_OK, response.status_code, response.content)
-
index 587dd14..b59f61b 100644 (file)
@@ -16,5 +16,5 @@ from django.conf.urls import url
 from mgr.swagger import views
 
 urlpatterns = [
-    url(r'^api/vnfmgr/v1/swagger.json$', views.SwaggerView.as_view()),
+    url(r'^api/vnfmgr/v1/swagger.json$', views.SwaggerView.as_view())
 ]
index e9c9604..e3de4f6 100644 (file)
@@ -11,6 +11,7 @@
 # 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.
+
 import os
 import json
 from rest_framework.views import APIView
@@ -18,9 +19,6 @@ from rest_framework.response import Response
 
 
 class SwaggerView(APIView):
-    """
-    Show rest api swagger.
-    """
     def get(self, request, format=None):
         json_file = os.path.join(os.path.dirname(__file__), 'swagger.json')
         f = open(json_file)
index 84b4ad1..f08cb22 100644 (file)
@@ -23,4 +23,3 @@ urlpatterns = [
 ]
 
 urlpatterns = format_suffix_patterns(urlpatterns)
-
index 6df7ce9..f5771c6 100644 (file)
@@ -26,6 +26,7 @@ from mgr.pub.utils import restcall
 
 logger = logging.getLogger(__name__)
 
+
 @api_view(http_method_names=['POST'])
 def add_vnf(request, *args, **kwargs):
     logger.info("Enter %s, data is %s", fun_name(), request.data)
@@ -49,7 +50,7 @@ def access_vnf(request, *args, **kwargs):
     vnf_inst_id = ignore_case_get(kwargs, "vnfInstId")
     logger.info("Enter %s, method is %s, ", fun_name(), request.method)
     logger.info("vnfInstId is %s, data is %s", vnf_inst_id, request.data)
-    ret, normal_status = None, None
+    ret, normal_status = None, None
     try:
         vnf = VnfRegModel.objects.filter(id=vnf_inst_id)
         if not vnf:
@@ -88,6 +89,7 @@ def access_vnf(request, *args, **kwargs):
         return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
     return Response(data=ret, status=normal_status)
 
+
 @api_view(http_method_names=['POST'])
 def vnf_config(request, *args, **kwargs):
     logger.info("Enter %s, data is %s", fun_name(), request.data)
@@ -109,4 +111,3 @@ def vnf_config(request, *args, **kwargs):
     except Exception as e:
         return Response(data={'error': e.message}, status=status.HTTP_500_INTERNAL_SERVER_ERROR)
     return Response(data={}, status=status.HTTP_202_ACCEPTED)
-    
\ No newline at end of file
index dfe3650..a6b401b 100644 (file)
@@ -12,7 +12,6 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-
 import os
 
 from django.core.wsgi import get_wsgi_application