Lint: E121/E126 continuation line under/over-indented for hanging indent

This commit is contained in:
Joshua Boniface 2020-11-07 14:58:13 -05:00
parent 9135c5e3e4
commit 6f66b77a00
9 changed files with 441 additions and 473 deletions

View File

@ -241,8 +241,7 @@ def run_benchmark(self, pool):
volume=volume,
test=test,
bs=test_matrix[test]['bs'],
rw=test_matrix[test]['rw']
)
rw=test_matrix[test]['rw'])
retcode, stdout, stderr = pvc_common.run_os_command(fio_cmd)
if retcode:

View File

@ -465,8 +465,7 @@ Wr: {osd_wrops: <{osd_wrops_length}} \
osd_wrops='OPS',
osd_wrdata='Data',
osd_rdops='OPS',
osd_rddata='Data'
)
osd_rddata='Data')
)
for osd_information in sorted(osd_list, key=lambda x: int(x['id'])):
@ -536,8 +535,7 @@ Wr: {osd_wrops: <{osd_wrops_length}} \
osd_wrops=osd_information['stats']['wr_ops'],
osd_wrdata=osd_information['stats']['wr_data'],
osd_rdops=osd_information['stats']['rd_ops'],
osd_rddata=osd_information['stats']['rd_data']
)
osd_rddata=osd_information['stats']['rd_data'])
)
return '\n'.join(osd_list_output)
@ -770,8 +768,7 @@ Wr: {pool_write_ops: <{pool_write_ops_length}} \
pool_write_ops='OPS',
pool_write_data='Data',
pool_read_ops='OPS',
pool_read_data='Data'
)
pool_read_data='Data')
)
for pool_information in sorted(pool_list, key=lambda x: int(x['stats']['id'])):
@ -818,8 +815,7 @@ Wr: {pool_write_ops: <{pool_write_ops_length}} \
pool_write_ops=pool_information['stats']['write_ops'],
pool_write_data=pool_information['stats']['write_bytes'],
pool_read_ops=pool_information['stats']['read_ops'],
pool_read_data=pool_information['stats']['read_bytes']
)
pool_read_data=pool_information['stats']['read_bytes'])
)
return '\n'.join(pool_list_output)
@ -1068,8 +1064,7 @@ def format_list_volume(volume_list):
volume_objects='Objects',
volume_order='Order',
volume_format='Format',
volume_features='Features',
)
volume_features='Features')
)
for volume_information in volume_list:
@ -1097,8 +1092,7 @@ def format_list_volume(volume_list):
volume_objects=volume_information['stats']['objects'],
volume_order=volume_information['stats']['order'],
volume_format=volume_information['stats']['format'],
volume_features=','.join(volume_information['stats']['features']),
)
volume_features=','.join(volume_information['stats']['features']))
)
return '\n'.join(sorted(volume_list_output))
@ -1258,8 +1252,7 @@ def format_list_snapshot(snapshot_list):
snapshot_pool_length=snapshot_pool_length,
snapshot_name='Name',
snapshot_volume='Volume',
snapshot_pool='Pool',
)
snapshot_pool='Pool')
)
for snapshot_information in snapshot_list:
@ -1278,8 +1271,7 @@ def format_list_snapshot(snapshot_list):
snapshot_pool_length=snapshot_pool_length,
snapshot_name=snapshot_name,
snapshot_volume=snapshot_volume,
snapshot_pool=snapshot_pool,
)
snapshot_pool=snapshot_pool)
)
return '\n'.join(sorted(snapshot_list_output))
@ -1387,8 +1379,7 @@ def format_list_benchmark(config, benchmark_information):
rand_header_length=benchmark_bandwidth_length['rand_read_4K'] + benchmark_bandwidth_length['rand_write_4K'] + benchmark_iops_length['rand_read_4K'] + benchmark_iops_length['rand_write_4K'] + 2,
benchmark_job='Benchmark Job',
seq_header='Sequential (4M blocks):',
rand_header='Random (4K blocks):'
)
rand_header='Random (4K blocks):')
)
benchmark_list_output.append('{bold}\
@ -1409,8 +1400,7 @@ def format_list_benchmark(config, benchmark_information):
seq_benchmark_bandwidth='R/W Bandwith/s',
seq_benchmark_iops='R/W IOPS',
rand_benchmark_bandwidth='R/W Bandwith/s',
rand_benchmark_iops='R/W IOPS'
)
rand_benchmark_iops='R/W IOPS')
)
for benchmark in benchmark_information:
@ -1452,8 +1442,7 @@ def format_list_benchmark(config, benchmark_information):
seq_benchmark_bandwidth=seq_benchmark_bandwidth,
seq_benchmark_iops=seq_benchmark_iops,
rand_benchmark_bandwidth=rand_benchmark_bandwidth,
rand_benchmark_iops=rand_benchmark_iops
)
rand_benchmark_iops=rand_benchmark_iops)
)
return '\n'.join(benchmark_list_output)

View File

@ -109,15 +109,11 @@ def format_info(cluster_information, oformat):
ainformation.append('{}Cluster health:{} {}{}{}'.format(ansiprint.purple(), ansiprint.end(), health_colour, cluster_information['health'], ansiprint.end()))
if cluster_information['health_msg']:
for line in cluster_information['health_msg']:
ainformation.append(
' > {}'.format(line)
)
ainformation.append(' > {}'.format(line))
ainformation.append('{}Storage health:{} {}{}{}'.format(ansiprint.purple(), ansiprint.end(), storage_health_colour, cluster_information['storage_health'], ansiprint.end()))
if cluster_information['storage_health_msg']:
for line in cluster_information['storage_health_msg']:
ainformation.append(
' > {}'.format(line)
)
ainformation.append(' > {}'.format(line))
ainformation.append('')
ainformation.append('{}Primary node:{} {}'.format(ansiprint.purple(), ansiprint.end(), cluster_information['primary_node']))
ainformation.append('{}Cluster upstream IP:{} {}'.format(ansiprint.purple(), ansiprint.end(), cluster_information['upstream_ip']))

View File

@ -497,8 +497,7 @@ def format_list(config, network_list):
net_v6_flag='IPv6',
net_dhcp6_flag='DHCPv6',
net_v4_flag='IPv4',
net_dhcp4_flag='DHCPv4',
)
net_dhcp4_flag='DHCPv4')
)
for network_information in network_list:
@ -513,8 +512,7 @@ def format_list(config, network_list):
else:
v6_flag = 'False'
network_list_output.append(
'{bold}\
network_list_output.append('{bold}\
{net_vni: <{net_vni_length}} \
{net_description: <{net_description_length}} \
{net_nettype: <{net_nettype_length}} \
@ -546,8 +544,7 @@ def format_list(config, network_list):
v4_flag_colour=v4_flag_colour,
net_dhcp4_flag=network_information['ip4']['dhcp_flag'],
dhcp4_flag_colour=dhcp4_flag_colour,
colour_off=ansiprint.end()
)
colour_off=ansiprint.end())
)
return '\n'.join(sorted(network_list_output))
@ -591,8 +588,7 @@ def format_list_dhcp(dhcp_lease_list):
lease_hostname='Hostname',
lease_ip4_address='IP Address',
lease_mac_address='MAC Address',
lease_timestamp='Timestamp'
)
lease_timestamp='Timestamp')
)
for dhcp_lease_information in dhcp_lease_list:
@ -611,8 +607,7 @@ def format_list_dhcp(dhcp_lease_list):
lease_hostname=str(dhcp_lease_information['hostname']),
lease_ip4_address=str(dhcp_lease_information['ip4_address']),
lease_mac_address=str(dhcp_lease_information['mac_address']),
lease_timestamp=str(dhcp_lease_information['timestamp'])
)
lease_timestamp=str(dhcp_lease_information['timestamp']))
)
return '\n'.join(sorted(dhcp_lease_list_output))
@ -663,8 +658,7 @@ def format_list_acl(acl_list):
acl_direction='Direction',
acl_order='Order',
acl_description='Description',
acl_rule='Rule',
)
acl_rule='Rule')
)
for acl_information in acl_list:
@ -683,8 +677,7 @@ def format_list_acl(acl_list):
acl_direction=acl_information['direction'],
acl_order=acl_information['order'],
acl_description=acl_information['description'],
acl_rule=acl_information['rule'],
)
acl_rule=acl_information['rule'])
)
return '\n'.join(sorted(acl_list_output))

View File

@ -833,8 +833,7 @@ Meta: {template_node_limit: <{template_node_limit_length}} \
template_node_limit='Limit',
template_node_selector='Selector',
template_node_autostart='Autostart',
template_migration_method='Migration'
)
template_migration_method='Migration')
# Format the string (elements)
for template in sorted(template_data, key=lambda i: i.get('name', None)):
@ -931,8 +930,7 @@ def format_list_template_network(template_template):
template_name='Name',
template_id='ID',
template_mac_template='MAC template',
template_networks='Network VNIs'
)
template_networks='Network VNIs')
# Format the string (elements)
for template in sorted(template_template, key=lambda i: i.get('name', None)):
@ -1041,8 +1039,7 @@ def format_list_template_storage(template_template):
template_disk_size='Size [GB]',
template_disk_filesystem='Filesystem',
template_disk_fsargs='Arguments',
template_disk_mountpoint='Mountpoint'
)
template_disk_mountpoint='Mountpoint')
# Format the string (elements)
for template in sorted(template_template, key=lambda i: i.get('name', None)):
@ -1121,8 +1118,7 @@ def format_list_userdata(userdata_data, lines=None):
end_bold=ansiprint.end(),
userdata_name='Name',
userdata_id='ID',
userdata_data='Document'
)
userdata_data='Document')
# Format the string (elements)
for data in sorted(userdata_data, key=lambda i: i.get('name', None)):
@ -1196,8 +1192,7 @@ def format_list_script(script_data, lines=None):
end_bold=ansiprint.end(),
script_name='Name',
script_id='ID',
script_data='Script'
)
script_data='Script')
# Format the string (elements)
for script in sorted(script_data, key=lambda i: i.get('name', None)):
@ -1311,8 +1306,7 @@ def format_list_ova(ova_data):
ova_disk_size='Size [GB]',
ova_disk_pool='Pool',
ova_disk_volume_format='Format',
ova_disk_volume_name='Source Volume',
)
ova_disk_volume_name='Source Volume')
# Format the string (elements)
for ova in sorted(ova_data, key=lambda i: i.get('name', None)):
@ -1443,8 +1437,7 @@ Data: {profile_userdata: <{profile_userdata_length}} \
profile_storage_template='Storage',
profile_userdata='Userdata',
profile_script='Script',
profile_arguments='Script Arguments'
)
profile_arguments='Script Arguments')
# Format the string (elements)
for profile in sorted(profile_data, key=lambda i: i.get('name', None)):
@ -1545,8 +1538,7 @@ VM: {task_vm_name: <{task_vm_name_length}} \
task_vm_name='Name',
task_vm_profile='Profile',
task_vm_define='Define?',
task_vm_start='Start?'
)
task_vm_start='Start?')
# Format the string (elements)
for task in sorted(task_data, key=lambda i: i.get('type', None)):

View File

@ -453,8 +453,7 @@ add rule inet filter forward ip6 saddr {netaddr6} counter jump {vxlannic}-out
output = "{}\n# User rules\n{}\n".format(
firewall_rules,
'\n'.join(full_ordered_rules)
)
'\n'.join(full_ordered_rules))
with open(self.nftables_netconf_filename, 'w') as nfnetfile:
nfnetfile.write(dedent(output))