From 959cc674521d99434bb4bf126cb367902aff15d3 Mon Sep 17 00:00:00 2001 From: Xiaohua Zhang Date: Tue, 27 Nov 2018 10:10:28 +0000 Subject: Fix pep8 error in windriver plugin Change-Id: Ifff45168c2647b20cacaf4b3ee0413f9a8a824a7 Issue-ID: MULTICLOUD-420 Signed-off-by: Xiaohua Zhang --- windriver/titanium_cloud/__init__.py | 2 +- windriver/titanium_cloud/celery.py | 1 + windriver/titanium_cloud/middleware.py | 3 +-- windriver/titanium_cloud/pub/__init__.py | 1 - windriver/titanium_cloud/pub/config/__init__.py | 1 - windriver/titanium_cloud/settings.py | 4 ++-- windriver/titanium_cloud/urls.py | 8 ++++---- 7 files changed, 9 insertions(+), 11 deletions(-) (limited to 'windriver') diff --git a/windriver/titanium_cloud/__init__.py b/windriver/titanium_cloud/__init__.py index e9fe5d03..f7fd66a2 100644 --- a/windriver/titanium_cloud/__init__.py +++ b/windriver/titanium_cloud/__init__.py @@ -18,4 +18,4 @@ from __future__ import absolute_import, unicode_literals # Django starts so that shared_task will use this app. from .celery import app as celery_app -__all__ = ['celery_app'] \ No newline at end of file +__all__ = ['celery_app'] diff --git a/windriver/titanium_cloud/celery.py b/windriver/titanium_cloud/celery.py index 368c5ddb..ada8bef5 100644 --- a/windriver/titanium_cloud/celery.py +++ b/windriver/titanium_cloud/celery.py @@ -33,6 +33,7 @@ app.autodiscover_tasks() logger = logging.getLogger(__name__) + @app.task(bind=True) def debug_task(self): logger.debug("self.request") diff --git a/windriver/titanium_cloud/middleware.py b/windriver/titanium_cloud/middleware.py index f2618e06..4f19da08 100644 --- a/windriver/titanium_cloud/middleware.py +++ b/windriver/titanium_cloud/middleware.py @@ -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 - diff --git a/windriver/titanium_cloud/pub/__init__.py b/windriver/titanium_cloud/pub/__init__.py index afa702d3..ae1ce9db 100644 --- a/windriver/titanium_cloud/pub/__init__.py +++ b/windriver/titanium_cloud/pub/__init__.py @@ -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. - diff --git a/windriver/titanium_cloud/pub/config/__init__.py b/windriver/titanium_cloud/pub/config/__init__.py index afa702d3..ae1ce9db 100644 --- a/windriver/titanium_cloud/pub/config/__init__.py +++ b/windriver/titanium_cloud/pub/config/__init__.py @@ -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. - diff --git a/windriver/titanium_cloud/settings.py b/windriver/titanium_cloud/settings.py index 6cf162a1..4d51c11a 100644 --- a/windriver/titanium_cloud/settings.py +++ b/windriver/titanium_cloud/settings.py @@ -96,7 +96,7 @@ CACHES = { MSB_SERVICE_ADDR = os.environ.get('MSB_ADDR', DEFAULT_MSB_ADDR) MSB_SERVICE_PORT = os.environ.get('MSB_PORT', "80") -#[Multicloud] +# [Multicloud] MULTICLOUD_PREFIX = "http://%s:%s/api/multicloud-titaniumcloud/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']['titanium_cloud_handler']['filename'] = 'logs/titanium_cloud.log' + # LOGGING['handlers']['titanium_cloud_handler']['filename'] = 'logs/titanium_cloud.log' REST_FRAMEWORK = {} import platform diff --git a/windriver/titanium_cloud/urls.py b/windriver/titanium_cloud/urls.py index 0387f2a4..e953140e 100644 --- a/windriver/titanium_cloud/urls.py +++ b/windriver/titanium_cloud/urls.py @@ -32,9 +32,9 @@ urlpatterns = [ url(r'^api/multicloud-titanium_cloud/v0/(?P[0-9a-zA-Z_-]+)/exten', include('titanium_cloud.extensions.urls')), url(r'^api/multicloud-titanium_cloud/v0/(?P[0-9a-zA-Z_-]+)/', - include('titanium_cloud.proxy.urls')), + include('titanium_cloud.proxy.urls')), url(r'^api/multicloud-titanium_cloud/v0/(?P[0-9a-zA-Z_-]+)/tenants/?$', - tenants.Tenants.as_view()), + tenants.Tenants.as_view()), url(r'^api/multicloud-titanium_cloud/v0/(?P[0-9a-zA-Z_-]+)/' '(?P[0-9a-zA-Z_-]{20,})/', include('titanium_cloud.requests.urls')), # CapacityCheck @@ -76,9 +76,9 @@ urlpatterns = [ url(r'^api/multicloud-titaniumcloud/v0/(?P[0-9a-zA-Z_-]+)/infra_workload/(?P[0-9a-zA-Z_-]*)/?$', infra_workload.InfraWorkload.as_view()), url(r'^api/multicloud-titaniumcloud/v0/(?P[0-9a-zA-Z_-]+)/', - include('titanium_cloud.proxy.urls')), + include('titanium_cloud.proxy.urls')), url(r'^api/multicloud-titaniumcloud/v0/(?P[0-9a-zA-Z_-]+)/tenants/?$', - tenants.Tenants.as_view()), + tenants.Tenants.as_view()), url(r'^api/multicloud-titaniumcloud/v0/(?P[0-9a-zA-Z_-]+)/' '(?P[0-9a-zA-Z_-]{20,})/', include('titanium_cloud.requests.urls')), # CapacityCheck -- cgit 1.2.3-korg