Lint: W293 blank line contains whitespace

This commit is contained in:
2020-11-06 19:05:48 -05:00
parent 2deee9a329
commit ebf254f62d
16 changed files with 68 additions and 68 deletions

View File

@ -115,7 +115,7 @@ def ceph_status(config):
return True, response.json()
else:
return False, response.json().get('message', '')
def ceph_util(config):
"""
Get utilization of the Ceph cluster
@ -130,7 +130,7 @@ def ceph_util(config):
return True, response.json()
else:
return False, response.json().get('message', '')
def format_raw_output(status_data):
ainformation = list()
ainformation.append('{bold}Ceph cluster {stype} (primary node {end}{blue}{primary}{end}{bold}){end}\n'.format(bold=ansiprint.bold(), end=ansiprint.end(), blue=ansiprint.blue(), stype=status_data['type'], primary=status_data['primary_node']))
@ -1272,7 +1272,7 @@ def ceph_benchmark_run(config, pool):
else:
retvalue = False
retdata = response.json().get('message', '')
return retvalue, retdata
def ceph_benchmark_list(config, job):
@ -1303,7 +1303,7 @@ def ceph_benchmark_list(config, job):
def format_list_benchmark(config, benchmark_information):
benchmark_list_output = []
benchmark_id_length = 3
benchmark_job_length = 20
benchmark_bandwidth_length = dict()
@ -1392,13 +1392,13 @@ def format_list_benchmark(config, benchmark_information):
benchmark_data = json.loads(benchmark['benchmark_result'])
benchmark_bandwidth[test] = format_bytes_tohuman(int(benchmark_data[test]['overall']['bandwidth']) * 1024)
benchmark_iops[test] = format_ops_tohuman(int(benchmark_data[test]['overall']['iops']))
seq_benchmark_bandwidth = "{} / {}".format(benchmark_bandwidth['seq_read'], benchmark_bandwidth['seq_write'])
seq_benchmark_iops = "{} / {}".format(benchmark_iops['seq_read'], benchmark_iops['seq_write'])
rand_benchmark_bandwidth = "{} / {}".format(benchmark_bandwidth['rand_read_4K'], benchmark_bandwidth['rand_write_4K'])
rand_benchmark_iops = "{} / {}".format(benchmark_iops['rand_read_4K'], benchmark_iops['rand_write_4K'])
benchmark_list_output.append('{bold}\
{benchmark_job: <{benchmark_job_length}} \
{seq_benchmark_bandwidth: <{seq_benchmark_bandwidth_length}} \

View File

@ -92,7 +92,7 @@ def net_list(config, limit):
def net_add(config, vni, description, nettype, domain, name_servers, ip4_network, ip4_gateway, ip6_network, ip6_gateway, dhcp4_flag, dhcp4_start, dhcp4_end):
"""
Add new network
API endpoint: POST /api/v1/network
API arguments: lots
API schema: {"message":"{data}"}
@ -123,7 +123,7 @@ def net_add(config, vni, description, nettype, domain, name_servers, ip4_network
def net_modify(config, net, description, domain, name_servers, ip4_network, ip4_gateway, ip6_network, ip6_gateway, dhcp4_flag, dhcp4_start, dhcp4_end):
"""
Modify a network
API endpoint: POST /api/v1/network/{net}
API arguments: lots
API schema: {"message":"{data}"}
@ -162,7 +162,7 @@ def net_modify(config, net, description, domain, name_servers, ip4_network, ip4_
def net_remove(config, net):
"""
Remove a network
API endpoint: DELETE /api/v1/network/{net}
API arguments:
API schema: {"message":"{data}"}
@ -221,7 +221,7 @@ def net_dhcp_list(config, net, limit, only_static=False):
def net_dhcp_add(config, net, ipaddr, macaddr, hostname):
"""
Add new network DHCP lease
API endpoint: POST /api/v1/network/{net}/lease
API arguments: macaddress=macaddr, ipaddress=ipaddr, hostname=hostname
API schema: {"message":"{data}"}
@ -243,7 +243,7 @@ def net_dhcp_add(config, net, ipaddr, macaddr, hostname):
def net_dhcp_remove(config, net, mac):
"""
Remove a network DHCP lease
API endpoint: DELETE /api/v1/network/{vni}/lease/{mac}
API arguments:
API schema: {"message":"{data}"}
@ -299,7 +299,7 @@ def net_acl_list(config, net, limit, direction):
def net_acl_add(config, net, direction, description, rule, order):
"""
Add new network acl
API endpoint: POST /api/v1/network/{net}/acl
API arguments: description=description, direction=direction, order=order, rule=rule
API schema: {"message":"{data}"}
@ -323,7 +323,7 @@ def net_acl_add(config, net, direction, description, rule, order):
def net_acl_remove(config, net, description):
"""
Remove a network ACL
API endpoint: DELETE /api/v1/network/{vni}/acl/{description}
API arguments:
API schema: {"message":"{data}"}

View File

@ -293,7 +293,7 @@ Mem (M): {node_mem_total: <{mem_total_length}} {node_mem_used: <{mem_used_length
node_mem_provisioned='Prov'
)
)
# Format the string (elements)
for node_information in node_list:
daemon_state_colour, coordinator_state_colour, domain_state_colour, mem_allocated_colour, mem_provisioned_colour = getOutputColours(node_information)

View File

@ -84,7 +84,7 @@ def template_add(config, params, template_type=None):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def template_modify(config, params, name, template_type):
@ -101,7 +101,7 @@ def template_modify(config, params, name, template_type):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def template_remove(config, name, template_type):
@ -118,7 +118,7 @@ def template_remove(config, name, template_type):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def template_element_add(config, name, element_id, params, element_type=None, template_type=None):
@ -135,7 +135,7 @@ def template_element_add(config, name, element_id, params, element_type=None, te
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def template_element_remove(config, name, element_id, element_type=None, template_type=None):
@ -152,7 +152,7 @@ def template_element_remove(config, name, element_id, element_type=None, templat
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def userdata_info(config, userdata):
@ -227,7 +227,7 @@ def userdata_add(config, params):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def userdata_modify(config, name, params):
@ -252,7 +252,7 @@ def userdata_modify(config, name, params):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def userdata_remove(config, name):
@ -269,7 +269,7 @@ def userdata_remove(config, name):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def script_info(config, script):
@ -344,7 +344,7 @@ def script_add(config, params):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def script_modify(config, name, params):
@ -369,7 +369,7 @@ def script_modify(config, name, params):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def script_remove(config, name):
@ -386,7 +386,7 @@ def script_remove(config, name):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def ova_info(config, name):
@ -469,7 +469,7 @@ def ova_remove(config, name):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def profile_info(config, profile):
@ -520,7 +520,7 @@ def profile_add(config, params):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def profile_modify(config, name, params):
@ -537,7 +537,7 @@ def profile_modify(config, name, params):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def profile_remove(config, name):
@ -554,7 +554,7 @@ def profile_remove(config, name):
retvalue = True
else:
retvalue = False
return retvalue, response.json().get('message', '')
def vm_create(config, name, profile, wait_flag, define_flag, start_flag, script_args):
@ -584,7 +584,7 @@ def vm_create(config, name, profile, wait_flag, define_flag, start_flag, script_
else:
retvalue = False
retdata = response.json().get('message', '')
return retvalue, retdata
def task_status(config, task_id=None, is_watching=False):

View File

@ -573,7 +573,7 @@ def format_list(config, vm_list, raw):
vm_migrated='Migrated'
)
)
# Keep track of nets we found to be valid to cut down on duplicate API hits
valid_net_list = []
# Format the string (elements)

View File

@ -1722,7 +1722,7 @@ def ceph_osd_add(node, device, weight, confirm_flag):
def ceph_osd_remove(osdid, confirm_flag):
"""
Remove a Ceph OSD with ID OSDID.
DANGER: This will completely remove the OSD from the cluster. OSDs will rebalance which may negatively affect performance or available space.
"""
if not confirm_flag:
@ -1992,7 +1992,7 @@ def ceph_volume_upload(pool, name, image_format, image_file):
def ceph_volume_remove(pool, name, confirm_flag):
"""
Remove a Ceph RBD volume with name NAME from pool POOL.
DANGER: This will completely remove the volume and all data contained in it.
"""
if not confirm_flag:
@ -2734,7 +2734,7 @@ def provisioner_template_storage_disk_add(name, disk, pool, source_volume, size,
Add a new DISK to storage template NAME.
DISK must be a Linux-style sdX/vdX disk identifier, such as "sda" or "vdb". All disks in a template must use the same identifier format.
Disks will be added to VMs in sdX/vdX order. For disks with mountpoints, ensure this order is sensible.
"""