Lint: E302 expected 2 blank lines, found X

This commit is contained in:
2020-11-07 14:45:24 -05:00
parent e9643651f7
commit 260b39ebf2
36 changed files with 694 additions and 19 deletions

View File

@ -26,6 +26,7 @@ import re
import cli_lib.ansiprint as ansiprint
from cli_lib.common import call_api, format_bytes, format_metric
#
# Primary functions
#
@ -53,6 +54,7 @@ def vm_info(config, vm):
else:
return False, response.json().get('message', '')
def vm_list(config, limit, target_node, target_state):
"""
Get list information about VMs (limited by {limit}, {target_node}, or {target_state})
@ -76,6 +78,7 @@ def vm_list(config, limit, target_node, target_state):
else:
return False, response.json().get('message', '')
def vm_define(config, xml, node, node_limit, node_selector, node_autostart, migration_method):
"""
Define a new VM on the cluster
@ -103,6 +106,7 @@ def vm_define(config, xml, node, node_limit, node_selector, node_autostart, migr
return retstatus, response.json().get('message', '')
def vm_modify(config, vm, xml, restart):
"""
Modify the configuration of VM
@ -126,6 +130,7 @@ def vm_modify(config, vm, xml, restart):
return retstatus, response.json().get('message', '')
def vm_metadata(config, vm, node_limit, node_selector, node_autostart, migration_method, provisioner_profile):
"""
Modify PVC metadata of a VM
@ -162,6 +167,7 @@ def vm_metadata(config, vm, node_limit, node_selector, node_autostart, migration
return retstatus, response.json().get('message', '')
def vm_remove(config, vm, delete_disks=False):
"""
Remove a VM
@ -182,6 +188,7 @@ def vm_remove(config, vm, delete_disks=False):
return retstatus, response.json().get('message', '')
def vm_state(config, vm, target_state, wait=False):
"""
Modify the current state of VM
@ -203,6 +210,7 @@ def vm_state(config, vm, target_state, wait=False):
return retstatus, response.json().get('message', '')
def vm_node(config, vm, target_node, action, force=False, wait=False, force_live=False):
"""
Modify the current node of VM via {action}
@ -227,6 +235,7 @@ def vm_node(config, vm, target_node, action, force=False, wait=False, force_live
return retstatus, response.json().get('message', '')
def vm_locks(config, vm):
"""
Flush RBD locks of (stopped) VM
@ -244,6 +253,7 @@ def vm_locks(config, vm):
return retstatus, response.json().get('message', '')
def view_console_log(config, vm, lines=100):
"""
Return console log lines from the API (and display them in a pager in the main CLI)
@ -268,6 +278,7 @@ def view_console_log(config, vm, lines=100):
return True, loglines
def follow_console_log(config, vm, lines=10):
"""
Return and follow console log lines from the API
@ -323,6 +334,7 @@ def follow_console_log(config, vm, lines=10):
return True, ''
#
# Output display functions
#
@ -478,6 +490,7 @@ def format_info(config, domain_information, long_output):
ainformation.append('')
return '\n'.join(ainformation)
def format_list(config, vm_list, raw):
# Handle single-element lists
if not isinstance(vm_list, list):