enable F811 check for flake8

This change incorporates two cleanups that do not change logic:
- Removes the shadowed unused imports by using the proper oslo.config import
mechanism
- duplicate unit tests have been removed
- duplicate unit test names have been corrected to reflect true test
  nature

Change-Id: Iad7a3373c1f787a2078b932c5f40bb718ad76767
Partial-Bug: 1329017
This commit is contained in:
Mark McClain 2014-06-11 21:23:53 -04:00
parent af203be75f
commit 0277a01b5b
6 changed files with 6 additions and 20 deletions

View File

@ -35,11 +35,12 @@ from neutron.common import utils as n_utils
from neutron import context
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.plugins.ibm.common import config # noqa
from neutron.plugins.ibm.common import constants
LOG = logging.getLogger(__name__)
cfg.CONF.import_group('SDNVE', 'neutron.plugins.ibm.common.config')
cfg.CONF.import_group('SDNVE_AGENT', 'neutron.plugins.ibm.common.config')
class SdnvePluginApi(agent_rpc.PluginApi):
@ -230,7 +231,6 @@ class SdnveNeutronAgent(n_rpc.RpcCallback):
def create_agent_config_map(config):
interface_mappings = n_utils.parse_mappings(
config.SDNVE.interface_mappings)

View File

@ -52,11 +52,11 @@ from neutron.plugins.ofagent.agent import constants as ofa_const
from neutron.plugins.ofagent.agent import flows
from neutron.plugins.ofagent.agent import ports
from neutron.plugins.ofagent.agent import tables
from neutron.plugins.ofagent.common import config # noqa
from neutron.plugins.openvswitch.common import constants
LOG = logging.getLogger(__name__)
cfg.CONF.import_group('AGENT', 'neutron.plugins.ofagent.common.config')
# A class to represent a VIF (i.e., a port that has 'iface-id' and 'vif-mac'

View File

@ -45,11 +45,11 @@ from neutron import context
from neutron.openstack.common import log as logging
from neutron.openstack.common import loopingcall
from neutron.plugins.common import constants as p_const
from neutron.plugins.openvswitch.common import config # noqa
from neutron.plugins.openvswitch.common import constants
LOG = logging.getLogger(__name__)
cfg.CONF.import_group('AGENT', 'neutron.plugins.openvswitch.common.config')
# A placeholder for dead vlans.
DEAD_VLAN_TAG = str(q_const.MAX_VLAN_TAG + 1)

View File

@ -17,7 +17,6 @@ import contextlib
import copy
import os
import contextlib
import mock
import netaddr
from oslo.config import cfg
@ -488,18 +487,6 @@ class TestNuageExtrarouteTestCase(NuagePluginV2TestCase,
{'floatingip': {'port_id': None}})
self.assertIsNone(fip['floatingip']['router_id'])
def test_network_update_external_failure(self):
self._test_network_update_external_failure()
def test_floatingip_create_different_fixed_ip_same_port(self):
self._test_floatingip_create_different_fixed_ip_same_port()
def test_floatingip_update_different_router(self):
self._test_floatingip_update_different_router()
def test_floatingip_update_different_fixed_ip_same_port(self):
self._test_floatingip_update_different_fixed_ip_same_port()
class NuageRouterTestExtensionManager(object):

View File

@ -3456,7 +3456,7 @@ class TestSubnetsV2(NeutronDbPluginV2TestCase):
self.assertEqual(res.status_int,
webob.exc.HTTPClientError.code)
def test_update_subnet_ipv6_ra_mode_fails(self):
def test_update_subnet_ipv6_address_mode_fails(self):
with self.subnet(ip_version=6, cidr='fe80::/64',
ipv6_address_mode=constants.IPV6_SLAAC) as subnet:
data = {'subnet': {'ipv6_address_mode': constants.DHCPV6_STATEFUL}}

View File

@ -65,7 +65,6 @@ commands = python setup.py build_sphinx
# E128 continuation line under-indented for visual indent
# E129 visually indented line with same indent as next logical line
# E265 block comment should start with #
# F811 redefinition of unused variable
# F812 list comprehension redefines name from line
# H237 module is removed in Python 3
# H305 imports not grouped correctly
@ -75,7 +74,7 @@ commands = python setup.py build_sphinx
# H405 multi line docstring summary not separated with an empty line
# H904 Wrap long lines in parentheses instead of a backslash
# TODO(marun) H404 multi line docstring should start with a summary
ignore = E125,E126,E128,E129,E265,F811,F812,H237,H305,H307,H401,H402,H404,H405,H904
ignore = E125,E126,E128,E129,E265,F812,H237,H305,H307,H401,H402,H404,H405,H904
show-source = true
builtins = _
exclude = .venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build,tools,.ropeproject,rally-scenarios