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)
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"),
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
# 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