Re-enable flake8
The line in tox.ini "select=H231" did not add H231 to the list of flake8 checks. It made us only run H231. Remove the H231 line and then fix the flake8 issues. The most substantial of these was the shadowing of the queue module with local variables named queue. Made that one import queue as queue_mod because changing the variable names in the code was yuckier to look at. Change-Id: I4a26a20889132f7f4525b17392088dda6bd5bbd2
This commit is contained in:
parent
55ab77bcb6
commit
616d56bc62
@ -27,9 +27,9 @@ from gear import constants
|
||||
from gear.acl import ACLError, ACLEntry, ACL # noqa
|
||||
|
||||
try:
|
||||
import Queue as queue
|
||||
import Queue as queue_mod
|
||||
except ImportError:
|
||||
import queue as queue
|
||||
import queue as queue_mod
|
||||
|
||||
try:
|
||||
import statsd
|
||||
@ -1718,7 +1718,7 @@ class Worker(BaseClient):
|
||||
self.functions = {}
|
||||
self.job_lock = threading.Lock()
|
||||
self.waiting_for_jobs = 0
|
||||
self.job_queue = queue.Queue()
|
||||
self.job_queue = queue_mod.Queue()
|
||||
|
||||
def __repr__(self):
|
||||
return '<gear.Worker 0x%x>' % id(self)
|
||||
@ -1885,7 +1885,7 @@ class Worker(BaseClient):
|
||||
|
||||
try:
|
||||
job = self.job_queue.get(False)
|
||||
except queue.Empty:
|
||||
except queue_mod.Empty:
|
||||
job = None
|
||||
|
||||
if not job:
|
||||
@ -2972,7 +2972,8 @@ class Server(BaseClientServer):
|
||||
def handleStatus(self, request):
|
||||
functions = self._getFunctionStats()
|
||||
for name, values in functions.items():
|
||||
request.connection.sendRaw(("%s\t%s\t%s\t%s\n" %
|
||||
request.connection.sendRaw(
|
||||
("%s\t%s\t%s\t%s\n" %
|
||||
(name.decode('utf-8'), values[0], values[1],
|
||||
values[2])).encode('utf8'))
|
||||
request.connection.sendRaw(b'.\n')
|
||||
|
@ -66,8 +66,8 @@ support.
|
||||
parser.add_argument('--keepalive-idle', dest='tcp_keepidle', type=int,
|
||||
default=7200, action='store',
|
||||
help='TCP keepalive idle time')
|
||||
parser.add_argument('--keepalive-interval', dest='tcp_keepintvl', type=int,
|
||||
default=75, action='store',
|
||||
parser.add_argument('--keepalive-interval', dest='tcp_keepintvl',
|
||||
type=int, default=75, action='store',
|
||||
help='TCP keepalive probe interval')
|
||||
parser.add_argument('--keepalive-count', dest='tcp_keepcnt', type=int,
|
||||
default=9, action='store',
|
||||
|
Loading…
x
Reference in New Issue
Block a user