[PATCH 1 of 6 cw-celerytask-helpers] flake8

Philippe Pepiot philippe.pepiot at logilab.fr
Wed Jun 20 17:59:50 CEST 2018


# HG changeset patch
# User Philippe Pepiot <philippe.pepiot at logilab.fr>
# Date 1529500020 -7200
#      Wed Jun 20 15:07:00 2018 +0200
# Node ID 9f7a57c3ca68f53d664f04d38cf45a57f89e021b
# Parent  886553ad7092328481b302ebcc3c97ab66ab2cdf
# Available At https://hg.logilab.org/review/cw-celerytask-helpers
#              hg pull https://hg.logilab.org/review/cw-celerytask-helpers -r 9f7a57c3ca68
flake8

diff --git a/cw_celerytask_helpers/redislogger.py b/cw_celerytask_helpers/redislogger.py
--- a/cw_celerytask_helpers/redislogger.py
+++ b/cw_celerytask_helpers/redislogger.py
@@ -9,7 +9,6 @@ import logging
 import json
 import datetime
 import sys
-import traceback
 
 import celery
 from celery._state import get_current_task
@@ -21,6 +20,7 @@ from .utils import get_redis_client
 PY2 = sys.version_info[0] == 2
 LOG_KEY_PREFIX = "cw:celerytask:log"
 
+
 class UnknownTaskId(Exception):
     pass
 
diff --git a/cw_celerytask_helpers/utils.py b/cw_celerytask_helpers/utils.py
--- a/cw_celerytask_helpers/utils.py
+++ b/cw_celerytask_helpers/utils.py
@@ -2,17 +2,19 @@ import celery
 import redis
 from redis.client import Redis
 
+
 def get_redis_client():
     conf = celery.current_app.conf
     url = conf.get('CUBICWEB_CELERYTASK_REDIS_URL')
     BROKER_TRANSPORT_OPTIONS = conf.get('BROKER_TRANSPORT_OPTIONS')
-    if url and url.startswith('redis-sentinel://') and 'sentinels' in BROKER_TRANSPORT_OPTIONS:
+    if (url and url.startswith('redis-sentinel://')
+            and 'sentinels' in BROKER_TRANSPORT_OPTIONS):
         from redis.sentinel import Sentinel
         service_name = BROKER_TRANSPORT_OPTIONS.get('service_name', 'master')
         socket_timeout = BROKER_TRANSPORT_OPTIONS.get('socket_timeout', 3)
         return Sentinel(BROKER_TRANSPORT_OPTIONS['sentinels'],
-                        socket_timeout=socket_timeout).master_for(service_name,
-                                                                  redis_class=Redis,
-                                                                  socket_timeout=socket_timeout)
+                        socket_timeout=socket_timeout).master_for(
+                            service_name, redis_class=Redis,
+                            socket_timeout=socket_timeout)
     elif url:
         return redis.Redis.from_url(url)


More information about the cubicweb-devel mailing list