enable E713 in pep8 tests
This change update the code style to enable the E713 check (test for membership should be ‘not in’) Partial-Bug: 1329017 Change-Id: I96f8b734db5964ef46d0911cb5f6e0b8c33c3119
This commit is contained in:
parent
e6569a5df7
commit
c4fba8d183
@ -345,7 +345,7 @@ class NeutronRestProxyV2Base(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
|
||||
def _extend_port_dict_binding(self, context, port):
|
||||
cfg_vif_type = cfg.CONF.NOVA.vif_type.lower()
|
||||
if not cfg_vif_type in (portbindings.VIF_TYPE_OVS,
|
||||
if cfg_vif_type not in (portbindings.VIF_TYPE_OVS,
|
||||
portbindings.VIF_TYPE_IVS):
|
||||
LOG.warning(_("Unrecognized vif_type in configuration "
|
||||
"[%s]. Defaulting to ovs."),
|
||||
|
@ -252,7 +252,7 @@ class MetaPluginV2(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
nets = []
|
||||
for flavor, plugin in self.plugins.items():
|
||||
if (filters and ext_flavor.FLAVOR_NETWORK in filters and
|
||||
not flavor in filters[ext_flavor.FLAVOR_NETWORK]):
|
||||
flavor not in filters[ext_flavor.FLAVOR_NETWORK]):
|
||||
continue
|
||||
if filters:
|
||||
#NOTE: copy each time since a target plugin may modify
|
||||
|
@ -353,7 +353,7 @@ class NeutronDbPluginV2TestCase(testlib_api.WebTestCase,
|
||||
if ('device_owner' in kwargs and
|
||||
kwargs['device_owner'] == constants.DEVICE_OWNER_DHCP and
|
||||
'host' in kwargs and
|
||||
not 'device_id' in kwargs):
|
||||
'device_id' not in kwargs):
|
||||
device_id = utils.get_dhcp_agent_device_id(net_id, kwargs['host'])
|
||||
data['port']['device_id'] = device_id
|
||||
port_req = self.new_create_request('ports', data, fmt)
|
||||
|
@ -303,7 +303,7 @@ class FakeClient:
|
||||
def _build_relation(self, src, dst, resource_type, relation):
|
||||
if relation not in self.MANAGED_RELATIONS[resource_type]:
|
||||
return # Relation is not desired in output
|
||||
if not '_relations' in src or not src['_relations'].get(relation):
|
||||
if '_relations' not in src or not src['_relations'].get(relation):
|
||||
return # Item does not have relation
|
||||
relation_data = src['_relations'].get(relation)
|
||||
dst_relations = dst.get('_relations', {})
|
||||
@ -402,7 +402,7 @@ class FakeClient:
|
||||
|
||||
def _lswitch_match(res_uuid):
|
||||
# verify that the switch exist
|
||||
if parent_uuid and not parent_uuid in self._fake_lswitch_dict:
|
||||
if parent_uuid and parent_uuid not in self._fake_lswitch_dict:
|
||||
raise Exception(_("lswitch:%s not found") % parent_uuid)
|
||||
if (not parent_uuid
|
||||
or res_dict[res_uuid].get('ls_uuid') == parent_uuid):
|
||||
@ -411,7 +411,7 @@ class FakeClient:
|
||||
|
||||
def _lrouter_match(res_uuid):
|
||||
# verify that the router exist
|
||||
if parent_uuid and not parent_uuid in self._fake_lrouter_dict:
|
||||
if parent_uuid and parent_uuid not in self._fake_lrouter_dict:
|
||||
raise Exception(_("lrouter:%s not found") % parent_uuid)
|
||||
if (not parent_uuid or
|
||||
res_dict[res_uuid].get('lr_uuid') == parent_uuid):
|
||||
|
3
tox.ini
3
tox.ini
@ -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 ‘# ‘
|
||||
# E713 test for membership should be ‘not in’
|
||||
# F402 import module shadowed by loop variable
|
||||
# F811 redefinition of unused variable
|
||||
# F812 list comprehension redefines name from line
|
||||
@ -77,7 +76,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,E713,F402,F811,F812,H237,H305,H307,H401,H402,H404,H405,H904
|
||||
ignore = E125,E126,E128,E129,E265,F402,F811,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
|
||||
|
Loading…
Reference in New Issue
Block a user