]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
enable E713 in pep8 tests
authorMark McClain <mmcclain@yahoo-inc.com>
Thu, 12 Jun 2014 00:53:18 +0000 (20:53 -0400)
committerMark McClain <mmcclain@yahoo-inc.com>
Thu, 23 Oct 2014 21:20:02 +0000 (17:20 -0400)
This change update the code style to enable the E713 check (test for membership
should be ‘not in’)

Partial-Bug: 1329017

Change-Id: I96f8b734db5964ef46d0911cb5f6e0b8c33c3119

neutron/plugins/bigswitch/plugin.py
neutron/plugins/metaplugin/meta_neutron_plugin.py
neutron/tests/unit/test_db_plugin.py
neutron/tests/unit/vmware/apiclient/fake.py
tox.ini

index e2e051d751cee5fe2591d3277211e645c233a709..400e8b31ac205bf13d36b12e4cead2356dd86114 100644 (file)
@@ -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."),
index f0b4ae45f752eba384769a25c4e50d7b561081dd..d8fb71a33bcbd23a496e083c9ac3de28169742eb 100644 (file)
@@ -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
index 74292fac074c6d7145ad254f0916190dfea666cd..b4ff7f58353cdfaa845ff75dcfac41e9c52c70a6 100644 (file)
@@ -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)
index 1b5cc0ee33d592be5c566628fdf5d218f0a717d0..99485805c474d7158a2b5b7db898c96de6e02bdc 100644 (file)
@@ -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):
diff --git a/tox.ini b/tox.ini
index d5a1d1386c506a74cd0ab9c128e4b211d36c45f0..63abb84613428e707982166dfe38a56c2fac2ecc 100644 (file)
--- a/tox.ini
+++ b/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