diff --git a/ods_ci/libs/Helpers.py b/ods_ci/libs/Helpers.py index 052555304..06a4f39f8 100644 --- a/ods_ci/libs/Helpers.py +++ b/ods_ci/libs/Helpers.py @@ -100,7 +100,7 @@ def update_notification_email_address(self, cluster_name, email_address, addon_n @keyword def convert_to_hours_and_minutes(self, seconds): """Converts seconds in hours and minutes""" - m, s = divmod(int(seconds), 60) + m, _ = divmod(int(seconds), 60) h, m = divmod(m, 60) return h, m diff --git a/ods_ci/utils/scripts/ocm/ocm.py b/ods_ci/utils/scripts/ocm/ocm.py index c17e4ddd5..3c57ff0bc 100644 --- a/ods_ci/utils/scripts/ocm/ocm.py +++ b/ods_ci/utils/scripts/ocm/ocm.py @@ -383,7 +383,7 @@ def add_machine_pool(self): if bool(self.reuse_machine_pool) and self.check_if_machine_pool_exists(): log.info(f"MachinePool with name {self.pool_name} exists in cluster {self.cluster_name}. Hence reusing it") else: - cluster_id = self.get_osd_cluster_id() + self.get_osd_cluster_id() cmd = "ocm --v={} create machinepool --cluster {} --instance-type {} --replicas {} --taints {} {}".format( self.ocm_verbose_level, self.cluster_id, diff --git a/ods_ci/utils/scripts/terraform/openstack/provision.py b/ods_ci/utils/scripts/terraform/openstack/provision.py index d4ac41bb6..14083f4e8 100644 --- a/ods_ci/utils/scripts/terraform/openstack/provision.py +++ b/ods_ci/utils/scripts/terraform/openstack/provision.py @@ -52,7 +52,7 @@ def create_instance(self): }, ) tf.init() - ret, out, err = tf.apply( + ret, _, err = tf.apply( no_color=IsFlagged, input=False, refresh=False, @@ -77,7 +77,7 @@ def delete_instance(self): }, ) tf.init() - ret, out, err = tf.destroy( + ret, _, err = tf.destroy( capture_output="yes", no_color=IsNotFlagged, force=IsNotFlagged, diff --git a/ods_ci/utils/scripts/testconfig/generateTestConfigFile.py b/ods_ci/utils/scripts/testconfig/generateTestConfigFile.py index ff74dd7e3..63b7b504c 100644 --- a/ods_ci/utils/scripts/testconfig/generateTestConfigFile.py +++ b/ods_ci/utils/scripts/testconfig/generateTestConfigFile.py @@ -142,7 +142,6 @@ def get_dashboard_url(): """ Get dashboard url for the open data science. """ - host_jsonpath = "{.spec.host}" cmd = "oc get route -A -o json | jq '.items[].spec.host' | grep 'dashboard'" dashboard_url = execute_command(cmd) diff --git a/ods_ci/utils/scripts/util.py b/ods_ci/utils/scripts/util.py index 6236594a8..0cd849e33 100644 --- a/ods_ci/utils/scripts/util.py +++ b/ods_ci/utils/scripts/util.py @@ -26,7 +26,7 @@ def clone_config_repo(**kwargs): shutil.rmtree(kwargs["repo_dir"]) os.makedirs(kwargs["repo_dir"]) print("git repo dir '%s' created successfully" % kwargs["repo_dir"]) - except OSError as error: + except OSError: print("git repo dir '%s' can not be created." % kwargs["repo_dir"]) return False @@ -49,7 +49,7 @@ def read_yaml(filename): try: with open(filename, "r") as fh: return yaml.safe_load(fh) - except OSError as error: + except OSError: return None diff --git a/pyproject.toml b/pyproject.toml index 157d506b2..ae19f3ab9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -126,7 +126,6 @@ ignore = [ # TODO "B006", # Do not use mutable data structures for argument defaults "COM812", # Trailing comma missing - "F841", # Local variable `response` is assigned to but never used "INP001", # File `ods_ci/tests/Resources/Page/ODH/JupyterHub/jupyter-helper.py` is part of an implicit namespace package. Add an `__init__.py`. "N806", # Variable `outputText` in function should be lowercase "N813", # Camelcase `ElementTree` imported as lowercase `et`