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)
# process_ip_rate_limit will treat value 0 as
# cleaning the tc filters if exits or no action.
return {constants.INGRESS_DIRECTION: {
return {
constants.INGRESS_DIRECTION: {
"rate": qos_base.IP_DEFAULT_RATE,
"burst": qos_base.IP_DEFAULT_BURST},
constants.EGRESS_DIRECTION: {

View File

@ -83,7 +83,8 @@ def verify_network_mtu():
success = True
for network in conn.network.networks():
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):
print("adapted_mtu tag is not set for the Network "
"[" + str(network.name) + "]")

View File

@ -81,7 +81,8 @@ def main():
qos_port_binding.policy_id)
continue
port_binding.profile = {'allocation':
port_binding.profile = {
'allocation':
converters.convert_to_sanitized_binding_profile_allocation(
allocation, port_binding.port_id, min_bw_rules)}
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 (split_line[1] == bad_i18n_module or
modulename != 'neutron' and split_line[1] in ('neutron.i18n',
'neutron._i18n')):
modulename != 'neutron' and split_line[1] in
('neutron.i18n', 'neutron._i18n')):
msg = ("N340: %(found)s is found. Use %(module)s._i18n instead."
% {'found': split_line[1], 'module': modulename})
yield (0, msg)

View File

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

View File

@ -547,14 +547,12 @@ class DBInconsistenciesPeriodics(SchemaAwarePeriodicsBase):
context = n_context.get_admin_context()
with self._nb_idl.transaction(check_error=True) as txn:
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(
ovn_const.OVN_SUBNET_POOL_EXT_ADDR_SCOPE4_KEY
) is None or
port.external_ids.get(
ovn_const.OVN_SUBNET_POOL_EXT_ADDR_SCOPE6_KEY
) is None
):
ovn_const.OVN_SUBNET_POOL_EXT_ADDR_SCOPE6_KEY)
is None):
try:
port_neutron = self._ovn_client._plugin.get_port(
context, port.name