Browse Source

Fix pylint errors

New pylint release catches 'consider-using-with' errors on some class
members. This new checker looks interesting for future errors but it is
not justified for the detected issues.

Change-Id: Iacf485f8d7ac61e79c3bc9073b40d0813c006745
changes/47/788047/1
Gregory Thiemonge 2 weeks ago
parent
commit
4e53676b2a
4 changed files with 5 additions and 0 deletions
  1. +1
    -0
      octavia/amphorae/backends/utils/network_namespace.py
  2. +2
    -0
      octavia/amphorae/drivers/health/heartbeat_udp.py
  3. +1
    -0
      octavia/common/base_taskflow.py
  4. +1
    -0
      octavia/controller/healthmanager/health_manager.py

+ 1
- 0
octavia/amphorae/backends/utils/network_namespace.py View File

@ -40,6 +40,7 @@ class NetworkNamespace(object):
def __enter__(self):
# Save the current network namespace
# pylint: disable=consider-using-with
self.current_netns_fd = open(self.current_netns)
with open(self.target_netns) as fd:
self.set_netns(fd.fileno(), self.CLONE_NEWNET)


+ 2
- 0
octavia/amphorae/drivers/health/heartbeat_udp.py View File

@ -53,8 +53,10 @@ class UDPStatusGetter(object):
self.sock = None
self.update(self.key, self.ip, self.port)
# pylint: disable=consider-using-with
self.health_executor = futures.ProcessPoolExecutor(
max_workers=CONF.health_manager.health_update_threads)
# pylint: disable=consider-using-with
self.stats_executor = futures.ProcessPoolExecutor(
max_workers=CONF.health_manager.stats_update_threads)
self.health_updater = UpdateHealthDb()


+ 1
- 0
octavia/common/base_taskflow.py View File

@ -57,6 +57,7 @@ class BaseTaskFlowEngine(object):
def __init__(self):
# work around for https://bugs.python.org/issue7980
datetime.datetime.strptime('2014-06-19 22:47:16', '%Y-%m-%d %H:%M:%S')
# pylint: disable=consider-using-with
self.executor = concurrent.futures.ThreadPoolExecutor(
max_workers=CONF.task_flow.max_workers)


+ 1
- 0
octavia/controller/healthmanager/health_manager.py View File

@ -63,6 +63,7 @@ class HealthManager(object):
else:
self.cw = cw1.ControllerWorker()
self.threads = CONF.health_manager.failover_threads
# pylint: disable=consider-using-with
self.executor = futures.ThreadPoolExecutor(max_workers=self.threads)
self.amp_repo = repo.AmphoraRepository()
self.amp_health_repo = repo.AmphoraHealthRepository()


Loading…
Cancel
Save