From 66230ce97121ecf279e9453fa6aac8815e4d4308 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Sat, 6 Nov 2021 03:21:04 -0400 Subject: [PATCH] Fix linting errors F522/F523 unused args --- api-daemon/pvcapid/provisioner.py | 2 +- client-cli/pvc/cli_lib/provisioner.py | 2 -- client-cli/pvc/cli_lib/vm.py | 3 --- node-daemon/pvcnoded/objects/CephInstance.py | 6 +++--- node-daemon/pvcnoded/objects/NodeInstance.py | 8 +++----- node-daemon/pvcnoded/objects/VMInstance.py | 5 +++-- 6 files changed, 10 insertions(+), 16 deletions(-) diff --git a/api-daemon/pvcapid/provisioner.py b/api-daemon/pvcapid/provisioner.py index b5690d90..d0aec608 100755 --- a/api-daemon/pvcapid/provisioner.py +++ b/api-daemon/pvcapid/provisioner.py @@ -1490,7 +1490,7 @@ def create_vm( if retcode: raise ProvisioningError( "Failed to find binary for mkswap: {}".format( - filesystem, stderr + stderr ) ) else: diff --git a/client-cli/pvc/cli_lib/provisioner.py b/client-cli/pvc/cli_lib/provisioner.py index 736b551f..397b4b4e 100644 --- a/client-cli/pvc/cli_lib/provisioner.py +++ b/client-cli/pvc/cli_lib/provisioner.py @@ -980,8 +980,6 @@ def format_list_template_system(template_data): {template_migration_method: <{template_migration_method_length}}{end_bold}".format( bold=ansiprint.bold(), end_bold=ansiprint.end(), - template_state_colour="", - end_colour="", template_name_length=template_name_length, template_id_length=template_id_length, template_vcpu_length=template_vcpu_length, diff --git a/client-cli/pvc/cli_lib/vm.py b/client-cli/pvc/cli_lib/vm.py index c9819066..50369ca3 100644 --- a/client-cli/pvc/cli_lib/vm.py +++ b/client-cli/pvc/cli_lib/vm.py @@ -320,7 +320,6 @@ def format_vm_tags(config, name, tags): "{bold}{tags_name: <{tags_name_length}} \ {tags_type: <{tags_type_length}} \ {tags_protected: <{tags_protected_length}}{end_bold}".format( - name_length=name_length, tags_name_length=tags_name_length, tags_type_length=tags_type_length, tags_protected_length=tags_protected_length, @@ -337,7 +336,6 @@ def format_vm_tags(config, name, tags): "{bold}{tags_name: <{tags_name_length}} \ {tags_type: <{tags_type_length}} \ {tags_protected: <{tags_protected_length}}{end_bold}".format( - name_length=name_length, tags_type_length=tags_type_length, tags_name_length=tags_name_length, tags_protected_length=tags_protected_length, @@ -1723,7 +1721,6 @@ def format_info(config, domain_information, long_output): ainformation.append( "{purple}Tags:{end} N/A".format( purple=ansiprint.purple(), - bold=ansiprint.bold(), end=ansiprint.end(), ) ) diff --git a/node-daemon/pvcnoded/objects/CephInstance.py b/node-daemon/pvcnoded/objects/CephInstance.py index 2582d3c2..4c0c1992 100644 --- a/node-daemon/pvcnoded/objects/CephInstance.py +++ b/node-daemon/pvcnoded/objects/CephInstance.py @@ -136,7 +136,7 @@ class CephOSDInstance(object): ) retcode, stdout, stderr = common.run_os_command( "ceph-volume lvm prepare --bluestore {devices}".format( - osdid=osd_id, devices=dev_flags + devices=dev_flags ) ) if retcode: @@ -150,7 +150,7 @@ class CephOSDInstance(object): "Getting OSD FSID for ID {} on {}".format(osd_id, device), state="i" ) retcode, stdout, stderr = common.run_os_command( - "ceph-volume lvm list {device}".format(osdid=osd_id, device=device) + "ceph-volume lvm list {device}".format(device=device) ) for line in stdout.split("\n"): if "osd fsid" in line: @@ -165,7 +165,7 @@ class CephOSDInstance(object): # 4b. Activate the OSD logger.out( - "Activating new OSD disk with ID {}".format(osd_id, device), state="i" + "Activating new OSD disk with ID {}".format(osd_id), state="i" ) retcode, stdout, stderr = common.run_os_command( "ceph-volume lvm activate --bluestore {osdid} {osdfsid}".format( diff --git a/node-daemon/pvcnoded/objects/NodeInstance.py b/node-daemon/pvcnoded/objects/NodeInstance.py index 7332f92a..6aac3c52 100644 --- a/node-daemon/pvcnoded/objects/NodeInstance.py +++ b/node-daemon/pvcnoded/objects/NodeInstance.py @@ -204,9 +204,7 @@ class NodeInstance(object): # Stop any existing flush jobs if self.flush_thread is not None: self.logger.out( - "Waiting for previous migration to complete".format( - self.name - ), + "Waiting for previous migration to complete", state="i", ) self.flush_stopper = True @@ -758,7 +756,7 @@ class NodeInstance(object): for dom_uuid in fixed_domain_list: # Allow us to cancel the operation if self.flush_stopper: - self.logger.out("Aborting node flush".format(self.name), state="i") + self.logger.out("Aborting node flush", state="i") self.flush_event.set() self.flush_thread = None self.flush_stopper = False @@ -838,7 +836,7 @@ class NodeInstance(object): for dom_uuid in fixed_domain_list: # Allow us to cancel the operation if self.flush_stopper: - self.logger.out("Aborting node unflush".format(self.name), state="i") + self.logger.out("Aborting node unflush", state="i") self.flush_event.set() self.flush_thread = None self.flush_stopper = False diff --git a/node-daemon/pvcnoded/objects/VMInstance.py b/node-daemon/pvcnoded/objects/VMInstance.py index 844ff1e3..66214325 100644 --- a/node-daemon/pvcnoded/objects/VMInstance.py +++ b/node-daemon/pvcnoded/objects/VMInstance.py @@ -1004,8 +1004,9 @@ class VMInstance(object): ): logger.out( "RBD lock does not belong to this host (lock owner: {}): freeing this lock would be unsafe, aborting".format( - lock["address"].split(":")[0], state="e" - ) + lock["address"].split(":")[0] + ), + state="e" ) zkhandler.write( [