Merge "Fix all pep8 E129 errors"
This commit is contained in:
commit
805359d9a2
@ -1122,7 +1122,8 @@ class Dnsmasq(DhcpLocalProcess):
|
||||
continue
|
||||
for alloc in port.fixed_ips:
|
||||
if (alloc.subnet_id in subnets and
|
||||
subnets[alloc.subnet_id].gateway_ip == alloc.ip_address):
|
||||
subnets[alloc.subnet_id].gateway_ip ==
|
||||
alloc.ip_address):
|
||||
isolated_subnets[alloc.subnet_id] = False
|
||||
|
||||
return isolated_subnets
|
||||
|
@ -170,7 +170,8 @@ class Controller(object):
|
||||
if attr_data and attr_data['is_visible']:
|
||||
if policy.check(
|
||||
context,
|
||||
'%s:%s' % (self._plugin_handlers[self.SHOW], attr_name),
|
||||
'%s:%s' % (self._plugin_handlers[self.SHOW],
|
||||
attr_name),
|
||||
data,
|
||||
might_not_exist=True,
|
||||
pluralized=self._collection):
|
||||
|
@ -74,7 +74,8 @@ class AgentSchedulerDbMixin(agents_db.AgentDbMixin):
|
||||
agent_notifier = self.agent_notifiers.get(original_agent['agent_type'])
|
||||
if (agent_notifier and
|
||||
'admin_state_up' in agent_data and
|
||||
original_agent['admin_state_up'] != agent_data['admin_state_up']):
|
||||
original_agent['admin_state_up'] !=
|
||||
agent_data['admin_state_up']):
|
||||
agent_notifier.agent_updated(context,
|
||||
agent_data['admin_state_up'],
|
||||
original_agent['host'])
|
||||
|
@ -1244,7 +1244,8 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
|
||||
|
||||
def _check_mac_addr_update(self, context, port, new_mac, device_owner):
|
||||
if (device_owner and
|
||||
device_owner.startswith(constants.DEVICE_OWNER_NETWORK_PREFIX)):
|
||||
device_owner.startswith(
|
||||
constants.DEVICE_OWNER_NETWORK_PREFIX)):
|
||||
raise n_exc.UnsupportedPortDeviceOwner(
|
||||
op=_("mac address update"), port_id=id,
|
||||
device_owner=device_owner)
|
||||
|
@ -721,8 +721,7 @@ class _DVRAgentInterfaceMixin(object):
|
||||
# All unbound ports with floatingip irrespective of
|
||||
# the device owner should be included as valid ports
|
||||
# and updated.
|
||||
if (port_in_migration or
|
||||
self._is_unbound_port(port)):
|
||||
if port_in_migration or self._is_unbound_port(port):
|
||||
port_dict.update({port['id']: port})
|
||||
continue
|
||||
port_host = port[portbindings.HOST_ID]
|
||||
|
@ -440,8 +440,7 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase):
|
||||
|
||||
def _validate_port_range(self, rule):
|
||||
"""Check that port_range is valid."""
|
||||
if (rule['port_range_min'] is None and
|
||||
rule['port_range_max'] is None):
|
||||
if rule['port_range_min'] is None and rule['port_range_max'] is None:
|
||||
return
|
||||
if not rule['protocol']:
|
||||
raise ext_sg.SecurityGroupProtocolRequiredWithPorts()
|
||||
|
@ -329,8 +329,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
host = attrs.get(portbindings.HOST_ID) or ''
|
||||
|
||||
original_host = binding.host
|
||||
if (validators.is_attr_set(host) and
|
||||
original_host != host):
|
||||
if validators.is_attr_set(host) and original_host != host:
|
||||
binding.host = host
|
||||
changes = True
|
||||
|
||||
@ -886,8 +885,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
|
||||
# relationship can be updated.
|
||||
context.session.expire(db_network)
|
||||
|
||||
if (
|
||||
mtuw_apidef.MTU in net_data or
|
||||
if (mtuw_apidef.MTU in net_data or
|
||||
# NOTE(ihrachys) mtu may be null for existing networks,
|
||||
# calculate and update it as needed; the conditional can be
|
||||
# removed in Queens when we populate all mtu attributes and
|
||||
|
@ -302,7 +302,8 @@ def get_unassigned_pd_interfaces(router):
|
||||
for intf in router[lib_constants.INTERFACE_KEY]:
|
||||
for subnet in intf['subnets']:
|
||||
if (ipv6_utils.is_ipv6_pd_enabled(subnet) and
|
||||
subnet['cidr'] == lib_constants.PROVISIONAL_IPV6_PD_PREFIX):
|
||||
subnet['cidr'] ==
|
||||
lib_constants.PROVISIONAL_IPV6_PD_PREFIX):
|
||||
pd_intfs.append(intf)
|
||||
return pd_intfs
|
||||
|
||||
@ -312,7 +313,8 @@ def assign_prefix_for_pd_interfaces(router):
|
||||
for ifno, intf in enumerate(router[lib_constants.INTERFACE_KEY]):
|
||||
for subnet in intf['subnets']:
|
||||
if (ipv6_utils.is_ipv6_pd_enabled(subnet) and
|
||||
subnet['cidr'] == lib_constants.PROVISIONAL_IPV6_PD_PREFIX):
|
||||
subnet['cidr'] ==
|
||||
lib_constants.PROVISIONAL_IPV6_PD_PREFIX):
|
||||
subnet['cidr'] = "2001:db8:%d::/64" % ifno
|
||||
pd_intfs.append(intf)
|
||||
return pd_intfs
|
||||
|
3
tox.ini
3
tox.ini
@ -137,7 +137,6 @@ commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck
|
||||
# E125 continuation line does not distinguish itself from next logical line
|
||||
# E126 continuation line over-indented for hanging indent
|
||||
# E128 continuation line under-indented for visual indent
|
||||
# E129 visually indented line with same indent as next logical line
|
||||
# H404 multi line docstring should start with a summary
|
||||
# H405 multi line docstring summary not separated with an empty line
|
||||
# N530 direct neutron imports not allowed
|
||||
@ -145,7 +144,7 @@ commands = sphinx-build -W -b linkcheck doc/source doc/build/linkcheck
|
||||
# N534 Untranslated exception message
|
||||
# TODO(amotoki) check the following new rules should be fixed or ignored
|
||||
# E731 do not assign a lambda expression, use a def
|
||||
ignore = E125,E126,E128,E129,E731,H404,H405,N530,N534
|
||||
ignore = E125,E126,E128,E731,H404,H405,N530,N534
|
||||
# H106: Don't put vim configuration in source files
|
||||
# H203: Use assertIs(Not)None to check for None
|
||||
# H204: Use assert(Not)Equal to check for equality
|
||||
|
Loading…
Reference in New Issue
Block a user