From 4f5ec2e88b104017950604e61b068efa36236eb1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 May 2024 20:57:24 +0530 Subject: [PATCH] [pre-commit.ci] pre-commit autoupdate (#14781) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/pre-commit/pre-commit-hooks: v4.4.0 → v4.6.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.4.0...v4.6.0) - [github.com/astral-sh/ruff-pre-commit: v0.4.1 → v0.4.3](https://github.com/astral-sh/ruff-pre-commit/compare/v0.4.1...v0.4.3) - [github.com/gitleaks/gitleaks: v8.18.0 → v8.18.2](https://github.com/gitleaks/gitleaks/compare/v8.18.0...v8.18.2) * Fix UP031 - Use format specifiers instead of percent format --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ondřej Gajdušek Co-authored-by: Gaurav Talreja (cherry picked from commit a71fa30366958005834f46836dd4d707723f1f90) --- .pre-commit-config.yaml | 8 ++++++-- robottelo/host_helpers/api_factory.py | 3 +-- tests/foreman/cli/test_computeresource_libvirt.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 119bcf0c12d..34cd415c87a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -5,14 +5,14 @@ ci: repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v4.6.0 hooks: - id: trailing-whitespace exclude: tests/foreman/data/ - id: check-yaml - id: debug-statements - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.4.1 + rev: v0.4.3 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] @@ -27,3 +27,7 @@ repos: verbose: true types: [text] require_serial: true + - repo: https://github.com/gitleaks/gitleaks + rev: v8.18.2 + hooks: + - id: gitleaks diff --git a/robottelo/host_helpers/api_factory.py b/robottelo/host_helpers/api_factory.py index 39ffac0c05f..53adbea396d 100644 --- a/robottelo/host_helpers/api_factory.py +++ b/robottelo/host_helpers/api_factory.py @@ -207,8 +207,7 @@ def wait_for_errata_applicability_task( max_age = now - from_when + 1 search_query = ( '( label = Actions::Katello::Host::GenerateApplicability OR label = ' - 'Actions::Katello::Host::UploadPackageProfile ) AND started_at > "%s seconds ago"' - % max_age + f'Actions::Katello::Host::UploadPackageProfile ) AND started_at > "{max_age} seconds ago"' ) tasks = self._satellite.api.ForemanTask().search(query={'search': search_query}) tasks_finished = 0 diff --git a/tests/foreman/cli/test_computeresource_libvirt.py b/tests/foreman/cli/test_computeresource_libvirt.py index 38d1b59a708..0b6035062a3 100644 --- a/tests/foreman/cli/test_computeresource_libvirt.py +++ b/tests/foreman/cli/test_computeresource_libvirt.py @@ -163,7 +163,7 @@ def test_positive_list(libvirt_url, module_target_sat): ) assert comp_res['name'] result_list = module_target_sat.cli.ComputeResource.list( - {'search': 'name=%s' % comp_res['name']} + {'search': 'name={}'.format(comp_res['name'])} ) assert len(result_list) > 0 result = module_target_sat.cli.ComputeResource.exists(search=('name', comp_res['name']))