diff --git a/quantum/plugins/midonet/midonet_lib.py b/quantum/plugins/midonet/midonet_lib.py index 9ad6b94ccf..8e2c1dfda0 100644 --- a/quantum/plugins/midonet/midonet_lib.py +++ b/quantum/plugins/midonet/midonet_lib.py @@ -903,7 +903,7 @@ class MidoClient: port_group_id = None # handle source - if not remote_ip_prefix is None: + if remote_ip_prefix is not None: nw_src_address, nw_src_length = remote_ip_prefix.split('/') elif not remote_group_id is None: # security group as a srouce source_pg = self.pg_manager.get_for_sg(tenant_id, remote_group_id) diff --git a/quantum/policy.py b/quantum/policy.py index 05e11ec103..610e4c5b85 100644 --- a/quantum/policy.py +++ b/quantum/policy.py @@ -99,7 +99,7 @@ def _set_rules(data): for actual_policy in ['_'.join(item) for item in itertools.product(new_actions, new_policies)]: - if not actual_policy in policies: + if actual_policy not in policies: # New policy, same rule LOG.info(_("Inserting policy:%(new_policy)s in place " "of deprecated policy:%(old_policy)s"), diff --git a/quantum/tests/unit/nicira/fake_nvpapiclient.py b/quantum/tests/unit/nicira/fake_nvpapiclient.py index d29d237d06..40ac6e853d 100644 --- a/quantum/tests/unit/nicira/fake_nvpapiclient.py +++ b/quantum/tests/unit/nicira/fake_nvpapiclient.py @@ -260,7 +260,7 @@ class FakeClient: return fake_gwservice def _build_relation(self, src, dst, resource_type, relation): - if not relation in self.MANAGED_RELATIONS[resource_type]: + 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): return # Item does not have relation diff --git a/tox.ini b/tox.ini index 5148995340..d111aeeb89 100644 --- a/tox.ini +++ b/tox.ini @@ -36,8 +36,7 @@ commands = {posargs} # H301 one import per line # H302 import only modules # TODO(marun) H404 multi line docstring should start with a summary -# TODO(marun) H901,902 use the not operator inline for clarity -ignore = E711,E712,E125,H301,H302,H404,H901,H902 +ignore = E711,E712,E125,H301,H302,H404 show-source = true builtins = _ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools