From 026a656893279ef980780a6abf0a56dc07c69ba0 Mon Sep 17 00:00:00 2001 From: Aaron Rosen Date: Fri, 1 Apr 2016 10:32:52 -0700 Subject: [PATCH] fix failing pep8 job This patch fixes the pep8 job which was failing with: N341 _ from python builtins module is used. Use _ from vmware_nsx._i18n instead Change-Id: I5be1646d6505dd3b2383abb28234f3ab612549a6 --- vmware_nsx/api_client/eventlet_client.py | 2 +- vmware_nsx/dvs/dvs_utils.py | 3 +++ vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py | 2 +- vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/vmware_nsx/api_client/eventlet_client.py b/vmware_nsx/api_client/eventlet_client.py index 1ca065d9c8..073ba08028 100644 --- a/vmware_nsx/api_client/eventlet_client.py +++ b/vmware_nsx/api_client/eventlet_client.py @@ -66,7 +66,7 @@ class EventletApiClient(base.ApiClientBase): # Connection pool is a list of queues. self._conn_pool = eventlet.queue.PriorityQueue() self._next_conn_priority = 1 - for _ in range(concurrent_connections): + for __ in range(concurrent_connections): for host, port, is_ssl in api_providers: conn = self._create_connection(host, port, is_ssl) self._conn_pool.put((self._next_conn_priority, conn)) diff --git a/vmware_nsx/dvs/dvs_utils.py b/vmware_nsx/dvs/dvs_utils.py index b3f8ced85f..3546a2c169 100644 --- a/vmware_nsx/dvs/dvs_utils.py +++ b/vmware_nsx/dvs/dvs_utils.py @@ -15,6 +15,9 @@ from oslo_config import cfg from oslo_vmware import api + +from vmware_nsx._i18n import _ + dvs_opts = [ cfg.StrOpt('host_ip', help='Hostname or IP address for connection to VMware vCenter ' diff --git a/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py b/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py index c6df3c5843..5778846c71 100644 --- a/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py +++ b/vmware_nsx/plugins/nsx_v/drivers/distributed_router_driver.py @@ -20,7 +20,7 @@ from neutron.db import l3_db from neutron_lib import exceptions as n_exc -from vmware_nsx._i18n import _LE +from vmware_nsx._i18n import _, _LE from vmware_nsx.common import locking from vmware_nsx.db import nsxv_db from vmware_nsx.plugins.nsx_v.drivers import ( diff --git a/vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py b/vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py index a49b64f2af..8cc086ba98 100644 --- a/vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py +++ b/vmware_nsx/shell/admin/plugins/nsxv/resources/dhcp_binding.py @@ -71,7 +71,7 @@ def list_missing_dhcp_bindings(resource, event, trigger, **kwargs): but are not present on corresponding NSXv Edge. """ - for (edge_id, _) in nsxv_db.get_nsxv_dhcp_bindings_count_per_edge( + for (edge_id, __) in nsxv_db.get_nsxv_dhcp_bindings_count_per_edge( neutron_db.context.session): LOG.info(_LI("%s"), "=" * 60) LOG.info(_LI("For edge: %s"), edge_id)