Fix some pylint indentation warnings

Running with a stricter .pylintrc generates a lot of
C0330 warnings (hanging/continued indentation). Fix
some remaining ones in miscellaneous directories.

Also cleanup any remaining code that I missed in this
series, or has changed since I started.

Trivialfix

Change-Id: I17b4779020a7bfb369c3e721ab6638cd4a6ab50c
This commit is contained in:
Brian Haley 2022-11-02 10:54:56 -04:00
parent d250c83f23
commit 86badcfe2d
16 changed files with 39 additions and 36 deletions

View File

@ -241,7 +241,8 @@ class FipQosAgentExtension(qos_base.L3QosAgentExtensionBase,
self.fip_qos_map.clean_by_resource(fip_res) self.fip_qos_map.clean_by_resource(fip_res)
# process_ip_rate_limit will treat value 0 as # process_ip_rate_limit will treat value 0 as
# cleaning the tc filters if exits or no action. # cleaning the tc filters if exits or no action.
return {constants.INGRESS_DIRECTION: { return {
constants.INGRESS_DIRECTION: {
"rate": qos_base.IP_DEFAULT_RATE, "rate": qos_base.IP_DEFAULT_RATE,
"burst": qos_base.IP_DEFAULT_BURST}, "burst": qos_base.IP_DEFAULT_BURST},
constants.EGRESS_DIRECTION: { constants.EGRESS_DIRECTION: {

View File

@ -83,7 +83,8 @@ def verify_network_mtu():
success = True success = True
for network in conn.network.networks(): for network in conn.network.networks():
if network.provider_physical_network is None and ( if network.provider_physical_network is None and (
network.provider_network_type in NETWORK_TYPE_OVERHEAD_DIFF) and ( network.provider_network_type in
NETWORK_TYPE_OVERHEAD_DIFF) and (
'adapted_mtu' not in network.tags): 'adapted_mtu' not in network.tags):
print("adapted_mtu tag is not set for the Network " print("adapted_mtu tag is not set for the Network "
"[" + str(network.name) + "]") "[" + str(network.name) + "]")

View File

@ -81,7 +81,8 @@ def main():
qos_port_binding.policy_id) qos_port_binding.policy_id)
continue continue
port_binding.profile = {'allocation': port_binding.profile = {
'allocation':
converters.convert_to_sanitized_binding_profile_allocation( converters.convert_to_sanitized_binding_profile_allocation(
allocation, port_binding.port_id, min_bw_rules)} allocation, port_binding.port_id, min_bw_rules)}
LOG.info('Port %s updated, New binding-profile.allocation format: ' LOG.info('Port %s updated, New binding-profile.allocation format: '

View File

@ -149,8 +149,8 @@ def check_oslo_i18n_wrapper(logical_line, filename, noqa):
if (len(split_line) > 1 and split_line[0] in ('import', 'from')): if (len(split_line) > 1 and split_line[0] in ('import', 'from')):
if (split_line[1] == bad_i18n_module or if (split_line[1] == bad_i18n_module or
modulename != 'neutron' and split_line[1] in ('neutron.i18n', modulename != 'neutron' and split_line[1] in
'neutron._i18n')): ('neutron.i18n', 'neutron._i18n')):
msg = ("N340: %(found)s is found. Use %(module)s._i18n instead." msg = ("N340: %(found)s is found. Use %(module)s._i18n instead."
% {'found': split_line[1], 'module': modulename}) % {'found': split_line[1], 'module': modulename})
yield (0, msg) yield (0, msg)

View File

@ -77,11 +77,13 @@ class SriovNicSwitchMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):
vnic_type_prohibit_list=prohibit_list) vnic_type_prohibit_list=prohibit_list)
# NOTE(ndipanov): PF passthrough requires a different vif type # NOTE(ndipanov): PF passthrough requires a different vif type
self.vnic_type_for_vif_type = ( def _vif_type(vtype):
{vtype: portbindings.VIF_TYPE_HOSTDEV_PHY return (portbindings.VIF_TYPE_HOSTDEV_PHY
if vtype == portbindings.VNIC_DIRECT_PHYSICAL if vtype == portbindings.VNIC_DIRECT_PHYSICAL
else portbindings.VIF_TYPE_HW_VEB else portbindings.VIF_TYPE_HW_VEB)
for vtype in self.supported_vnic_types})
self.vnic_type_for_vif_type = (
{vtype: _vif_type(vtype) for vtype in self.supported_vnic_types})
self.vif_details = vif_details self.vif_details = vif_details
sriov_qos_driver.register() sriov_qos_driver.register()

View File

@ -547,14 +547,12 @@ class DBInconsistenciesPeriodics(SchemaAwarePeriodicsBase):
context = n_context.get_admin_context() context = n_context.get_admin_context()
with self._nb_idl.transaction(check_error=True) as txn: with self._nb_idl.transaction(check_error=True) as txn:
for port in ports: for port in ports:
if ( if (port.external_ids.get(
ovn_const.OVN_SUBNET_POOL_EXT_ADDR_SCOPE4_KEY)
is None or
port.external_ids.get( port.external_ids.get(
ovn_const.OVN_SUBNET_POOL_EXT_ADDR_SCOPE4_KEY ovn_const.OVN_SUBNET_POOL_EXT_ADDR_SCOPE6_KEY)
) is None or is None):
port.external_ids.get(
ovn_const.OVN_SUBNET_POOL_EXT_ADDR_SCOPE6_KEY
) is None
):
try: try:
port_neutron = self._ovn_client._plugin.get_port( port_neutron = self._ovn_client._plugin.get_port(
context, port.name context, port.name