Fix others pep8 error for ocata 90/75790/1
authorHaibin Huang <haibin.huang@intel.com>
Tue, 15 Jan 2019 02:45:38 +0000 (10:45 +0800)
committerHaibin Huang <haibin.huang@intel.com>
Tue, 15 Jan 2019 02:54:08 +0000 (10:54 +0800)
This patch is only fixing the pep8 issues under the others
folder for ocata release, which is only triggered by tox mannually.

Change-Id: Ia6f646a1b856451f2a73f5d33eead631d15a43aa
Issue-ID: MULTICLOUD-434
Signed-off-by: Haibin Huang <haibin.huang@intel.com>
13 files changed:
ocata/manage.py
ocata/ocata/celery.py
ocata/ocata/middleware.py
ocata/ocata/pub/__init__.py
ocata/ocata/pub/config/__init__.py
ocata/ocata/samples/__init__.py
ocata/ocata/samples/tests.py
ocata/ocata/settings.py
ocata/ocata/swagger/__init__.py
ocata/ocata/swagger/tests.py
ocata/ocata/swagger/urls.py
ocata/ocata/swagger/views.py
ocata/ocata/urls.py

index 8eaeff1..7e19a93 100644 (file)
@@ -3,7 +3,7 @@
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
-#         
+#
 #         http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
index ee533b5..3dd5d1e 100644 (file)
@@ -33,6 +33,7 @@ app.autodiscover_tasks()
 
 logger = logging.getLogger(__name__)
 
+
 @app.task(bind=True)
 def debug_task(self):
     logger.debug("self.request")
index f2618e0..4f19da0 100644 (file)
@@ -19,6 +19,7 @@ from onaplogging.mdcContext import MDC
 FORWARDED_FOR_FIELDS = ["HTTP_X_FORWARDED_FOR", "HTTP_X_FORWARDED_HOST",
                         "HTTP_X_FORWARDED_SERVER"]
 
+
 class LogContextMiddleware(object):
 
     #  the last IP behind multiple proxies,  if no exist proxies
@@ -43,7 +44,6 @@ class LogContextMiddleware(object):
 
         return ip
 
-
     def process_request(self, request):
         # fetch propageted Id from other component. if do not fetch id,
         # generate one.
@@ -62,4 +62,3 @@ class LogContextMiddleware(object):
 
         MDC.clear()
         return response
-
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 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 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 b294a52..02c5924 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 1e86178..dd59f6b 100644 (file)
@@ -93,7 +93,7 @@ CACHES = {
 MSB_SERVICE_ADDR = os.environ.get('MSB_ADDR', "127.0.0.1")
 MSB_SERVICE_PORT = os.environ.get('MSB_PORT', "80")
 
-#[Multicloud]
+# [Multicloud]
 MULTICLOUD_PREFIX = "http://%s:%s/api/multicloud-ocata/v0" % (
     MSB_SERVICE_ADDR, MSB_SERVICE_PORT)
 
@@ -129,7 +129,7 @@ config.yamlConfig(filepath=LOGGING_FILE, watchDog=True)
 
 if 'test' in sys.argv:
 
-    #LOGGING['handlers']['ocata_handler']['filename'] = 'logs/ocata.log'
+    # LOGGING['handlers']['ocata_handler']['filename'] = 'logs/ocata.log'
 
     REST_FRAMEWORK = {}
     import platform
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 323f512..0d02596 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 9f12227..dcc429a 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 ocata.swagger.views import SwaggerJsonView
index 27ea365..30536d7 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-ocata/v0/"
             json_data["info"]["title"] = "Service NBI of MultiCloud plugin for OpenStack Ocata"
             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-ocata/v1/"
             json_data["info"]["title"] = "Service NBI v1 of MultiCloud plugin for Ocata"
             return Response(data=json_data, status=200)
         else:
-            return Response(data={'error':'internal error'}, status=500)
+            return Response(data={'error': 'internal error'}, status=500)
index a055af4..5fb1e97 100644 (file)
@@ -31,9 +31,9 @@ urlpatterns = [
     url(r'^api/multicloud-ocata/v0/(?P<vimid>[0-9a-zA-Z_-]+)/exten',
         include('ocata.extensions.urls')),
     url(r'^api/multicloud-ocata/v0/(?P<vimid>[0-9a-zA-Z_-]+)/',
-             include('ocata.proxy.urls')),
+        include('ocata.proxy.urls')),
     url(r'^api/multicloud-ocata/v0/(?P<vimid>[0-9a-zA-Z_-]+)/tenants$',
-             tenants.Tenants.as_view()),
+        tenants.Tenants.as_view()),
     url(r'^api/multicloud-ocata/v0/(?P<vimid>[0-9a-zA-Z_-]+)/'
         '(?P<tenantid>[0-9a-zA-Z_-]{20,})/', include('ocata.requests.urls')),
     # CapacityCheck
@@ -67,5 +67,3 @@ urlpatterns = [
     url(r'^api/multicloud-ocata/v1/(?P<cloud_owner>[0-9a-zA-Z_-]+)/(?P<cloud_region_id>[0-9a-zA-Z_-]+)/infra_workload/(?P<requri>[0-9a-zA-Z_-]*)/?$',
         infra_workload.APIv1InfraWorkload.as_view()),
 ]
-
-