Merge "Fix all pep8 E129 errors"

This commit is contained in:
Zuul 2018-05-04 00:16:32 +00:00 committed by Gerrit Code Review
commit 805359d9a2
60 changed files with 130 additions and 129 deletions

View File

@ -1122,7 +1122,8 @@ class Dnsmasq(DhcpLocalProcess):
continue continue
for alloc in port.fixed_ips: for alloc in port.fixed_ips:
if (alloc.subnet_id in subnets and 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 isolated_subnets[alloc.subnet_id] = False
return isolated_subnets return isolated_subnets

View File

@ -170,7 +170,8 @@ class Controller(object):
if attr_data and attr_data['is_visible']: if attr_data and attr_data['is_visible']:
if policy.check( if policy.check(
context, context,
'%s:%s' % (self._plugin_handlers[self.SHOW], attr_name), '%s:%s' % (self._plugin_handlers[self.SHOW],
attr_name),
data, data,
might_not_exist=True, might_not_exist=True,
pluralized=self._collection): pluralized=self._collection):

View File

@ -74,7 +74,8 @@ class AgentSchedulerDbMixin(agents_db.AgentDbMixin):
agent_notifier = self.agent_notifiers.get(original_agent['agent_type']) agent_notifier = self.agent_notifiers.get(original_agent['agent_type'])
if (agent_notifier and if (agent_notifier and
'admin_state_up' in agent_data 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_notifier.agent_updated(context,
agent_data['admin_state_up'], agent_data['admin_state_up'],
original_agent['host']) original_agent['host'])

View File

@ -1244,7 +1244,8 @@ class NeutronDbPluginV2(db_base_plugin_common.DbBasePluginCommon,
def _check_mac_addr_update(self, context, port, new_mac, device_owner): def _check_mac_addr_update(self, context, port, new_mac, device_owner):
if (device_owner and if (device_owner and
device_owner.startswith(constants.DEVICE_OWNER_NETWORK_PREFIX)): device_owner.startswith(
constants.DEVICE_OWNER_NETWORK_PREFIX)):
raise n_exc.UnsupportedPortDeviceOwner( raise n_exc.UnsupportedPortDeviceOwner(
op=_("mac address update"), port_id=id, op=_("mac address update"), port_id=id,
device_owner=device_owner) device_owner=device_owner)

View File

@ -721,8 +721,7 @@ class _DVRAgentInterfaceMixin(object):
# All unbound ports with floatingip irrespective of # All unbound ports with floatingip irrespective of
# the device owner should be included as valid ports # the device owner should be included as valid ports
# and updated. # and updated.
if (port_in_migration or if port_in_migration or self._is_unbound_port(port):
self._is_unbound_port(port)):
port_dict.update({port['id']: port}) port_dict.update({port['id']: port})
continue continue
port_host = port[portbindings.HOST_ID] port_host = port[portbindings.HOST_ID]

View File

@ -440,8 +440,7 @@ class SecurityGroupDbMixin(ext_sg.SecurityGroupPluginBase):
def _validate_port_range(self, rule): def _validate_port_range(self, rule):
"""Check that port_range is valid.""" """Check that port_range is valid."""
if (rule['port_range_min'] is None and if rule['port_range_min'] is None and rule['port_range_max'] is None:
rule['port_range_max'] is None):
return return
if not rule['protocol']: if not rule['protocol']:
raise ext_sg.SecurityGroupProtocolRequiredWithPorts() raise ext_sg.SecurityGroupProtocolRequiredWithPorts()

View File

@ -329,8 +329,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
host = attrs.get(portbindings.HOST_ID) or '' host = attrs.get(portbindings.HOST_ID) or ''
original_host = binding.host original_host = binding.host
if (validators.is_attr_set(host) and if validators.is_attr_set(host) and original_host != host:
original_host != host):
binding.host = host binding.host = host
changes = True changes = True
@ -886,8 +885,7 @@ class Ml2Plugin(db_base_plugin_v2.NeutronDbPluginV2,
# relationship can be updated. # relationship can be updated.
context.session.expire(db_network) context.session.expire(db_network)
if ( if (mtuw_apidef.MTU in net_data or
mtuw_apidef.MTU in net_data or
# NOTE(ihrachys) mtu may be null for existing networks, # NOTE(ihrachys) mtu may be null for existing networks,
# calculate and update it as needed; the conditional can be # calculate and update it as needed; the conditional can be
# removed in Queens when we populate all mtu attributes and # removed in Queens when we populate all mtu attributes and

View File

@ -302,7 +302,8 @@ def get_unassigned_pd_interfaces(router):
for intf in router[lib_constants.INTERFACE_KEY]: for intf in router[lib_constants.INTERFACE_KEY]:
for subnet in intf['subnets']: for subnet in intf['subnets']:
if (ipv6_utils.is_ipv6_pd_enabled(subnet) and 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) pd_intfs.append(intf)
return pd_intfs 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 ifno, intf in enumerate(router[lib_constants.INTERFACE_KEY]):
for subnet in intf['subnets']: for subnet in intf['subnets']:
if (ipv6_utils.is_ipv6_pd_enabled(subnet) and 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 subnet['cidr'] = "2001:db8:%d::/64" % ifno
pd_intfs.append(intf) pd_intfs.append(intf)
return pd_intfs return pd_intfs

View File

@ -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 # E125 continuation line does not distinguish itself from next logical line
# E126 continuation line over-indented for hanging indent # E126 continuation line over-indented for hanging indent
# E128 continuation line under-indented for visual 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 # H404 multi line docstring should start with a summary
# H405 multi line docstring summary not separated with an empty line # H405 multi line docstring summary not separated with an empty line
# N530 direct neutron imports not allowed # 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 # N534 Untranslated exception message
# TODO(amotoki) check the following new rules should be fixed or ignored # TODO(amotoki) check the following new rules should be fixed or ignored
# E731 do not assign a lambda expression, use a def # 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 # H106: Don't put vim configuration in source files
# H203: Use assertIs(Not)None to check for None # H203: Use assertIs(Not)None to check for None
# H204: Use assert(Not)Equal to check for equality # H204: Use assert(Not)Equal to check for equality