From 8539ea018b2217ffeab6f082de0253f2656972b7 Mon Sep 17 00:00:00 2001 From: "salt-extensions-renovatebot[bot]" <182623858+salt-extensions-renovatebot[bot]@users.noreply.github.com> Date: Thu, 17 Oct 2024 02:11:21 +0000 Subject: [PATCH 1/2] Update dependency https://github.com/lkubb/salt-extension-copier to v0.5.2 --- .copier-answers.yml | 4 +-- .github/workflows/deploy-docs-action.yml | 2 +- .github/workflows/docs-action.yml | 6 ++-- .github/workflows/get-changed-files.yml | 2 +- .github/workflows/package-action.yml | 6 ++-- .github/workflows/pre-commit-action.yml | 4 +-- .github/workflows/tag.yml | 2 +- .github/workflows/test-action.yml | 39 ++++++++++++------------ .pre-commit-config.yaml | 20 ++++++------ .pylintrc | 2 +- noxfile.py | 8 ++--- pyproject.toml | 3 +- src/saltext/vault/modules/vault_pki.py | 2 +- src/saltext/vault/utils/vault/pki.py | 2 +- tests/conftest.py | 19 +++++++----- tests/unit/runners/vault/test_vault.py | 39 ++++++++++++++---------- tests/unit/utils/vault/test_api.py | 15 +++++---- 17 files changed, 93 insertions(+), 82 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 1c33d0b..c456fbe 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,6 +1,6 @@ # Autogenerated. Do not edit this by hand, use `copier update`. --- -_commit: 0.5.0 +_commit: 0.5.2 _src_path: https://github.com/lkubb/salt-extension-copier author: Salt Core Team author_email: saltproject@vmware.com @@ -26,7 +26,7 @@ os_support: - Windows package_name: vault project_name: vault -python_requires: '3.8' +python_requires: '3.9' relax_pylint: false salt_version: '3006' source_url: https://github.com/salt-extensions/saltext-vault diff --git a/.github/workflows/deploy-docs-action.yml b/.github/workflows/deploy-docs-action.yml index d4bf10d..4a935b5 100644 --- a/.github/workflows/deploy-docs-action.yml +++ b/.github/workflows/deploy-docs-action.yml @@ -71,7 +71,7 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: exitstatus-${{ github.job }} path: exitstatus diff --git a/.github/workflows/docs-action.yml b/.github/workflows/docs-action.yml index 8a5c751..8d284ec 100644 --- a/.github/workflows/docs-action.yml +++ b/.github/workflows/docs-action.yml @@ -10,7 +10,7 @@ jobs: timeout-minutes: 10 steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 @@ -35,7 +35,7 @@ jobs: nox --force-color -e docs - name: Upload built docs as artifact - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: html-docs path: docs/_build/html @@ -48,7 +48,7 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: exitstatus-${{ github.job }} path: exitstatus diff --git a/.github/workflows/get-changed-files.yml b/.github/workflows/get-changed-files.yml index 3e568c0..3d61e7e 100644 --- a/.github/workflows/get-changed-files.yml +++ b/.github/workflows/get-changed-files.yml @@ -17,7 +17,7 @@ jobs: changed-files: ${{ toJSON(steps.changed-files.outputs) }} steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Get Changed Files id: changed-files diff --git a/.github/workflows/package-action.yml b/.github/workflows/package-action.yml index 818b1aa..80b656c 100644 --- a/.github/workflows/package-action.yml +++ b/.github/workflows/package-action.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 0 @@ -38,7 +38,7 @@ jobs: run: python -m build --outdir dist/ - name: Upload build artifacts - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 if: always() with: name: salt-extension-${{ inputs.version }}-packages @@ -53,7 +53,7 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: exitstatus-${{ github.job }} path: exitstatus diff --git a/.github/workflows/pre-commit-action.yml b/.github/workflows/pre-commit-action.yml index ebf639a..cbdfdb4 100644 --- a/.github/workflows/pre-commit-action.yml +++ b/.github/workflows/pre-commit-action.yml @@ -23,7 +23,7 @@ jobs: apt-get install -y enchant-2 git gcc make zlib1g-dev libc-dev libffi-dev g++ libxml2 libxml2-dev libxslt-dev libcurl4-openssl-dev libssl-dev libgnutls28-dev git config --global --add safe.directory "$(pwd)" - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Install Pre-Commit run: | @@ -49,7 +49,7 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: exitstatus-${{ github.job }} path: exitstatus diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml index 33eded8..bb0bfa2 100644 --- a/.github/workflows/tag.yml +++ b/.github/workflows/tag.yml @@ -13,7 +13,7 @@ jobs: version: ${{ steps.get_version.outputs.version }} steps: - name: Checkout code - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 - name: Extract tag name id: get_version diff --git a/.github/workflows/test-action.yml b/.github/workflows/test-action.yml index d44fbed..301f021 100644 --- a/.github/workflows/test-action.yml +++ b/.github/workflows/test-action.yml @@ -12,16 +12,15 @@ jobs: strategy: fail-fast: false - max-parallel: 4 + max-parallel: 3 matrix: include: - - {salt-version: "3006.9", python-version: "3.8"} - {salt-version: "3006.9", python-version: "3.9"} - {salt-version: "3006.9", python-version: "3.10"} - {salt-version: "3007.1", python-version: "3.10"} steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 2 # coverage: Issue detecting commit SHA @@ -69,7 +68,7 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},project name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project use_oidc: true - version: v0.7.5 + version: v0.7.6 - name: Upload Tests Code Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 @@ -80,11 +79,11 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},tests name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests use_oidc: true - version: v0.7.5 + version: v0.7.6 - name: Upload Logs if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log path: artifacts/runtests-*.log @@ -97,7 +96,7 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: exitstatus-${{ github.job }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }} path: exitstatus @@ -112,11 +111,11 @@ jobs: max-parallel: 2 matrix: include: - - {salt-version: "3006.9", python-version: "3.8"} - - {salt-version: "3007.1", python-version: "3.8"} + - {salt-version: "3006.9", python-version: "3.9"} + - {salt-version: "3007.1", python-version: "3.9"} steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 2 @@ -175,7 +174,7 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},project name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project use_oidc: true - version: v0.7.5 + version: v0.7.6 - name: Upload Tests Code Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 @@ -186,11 +185,11 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},tests name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests use_oidc: true - version: v0.7.5 + version: v0.7.6 - name: Upload Logs if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log path: artifacts/runtests-*.log @@ -203,7 +202,7 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: exitstatus-${{ github.job }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }} path: exitstatus @@ -218,11 +217,11 @@ jobs: max-parallel: 2 matrix: include: - - {salt-version: "3006.9", python-version: "3.9"} + - {salt-version: "3006.9", python-version: "3.10"} - {salt-version: "3007.1", python-version: "3.10"} steps: - - uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 + - uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1 with: fetch-depth: 2 @@ -264,7 +263,7 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},project name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-project use_oidc: true - version: v0.7.5 + version: v0.7.6 - name: Upload Tests Code Coverage uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0 @@ -275,11 +274,11 @@ jobs: flags: ${{ steps.codecov-flags.outputs.flags }},tests name: ${{ runner.os }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}-tests use_oidc: true - version: v0.7.5 + version: v0.7.6 - name: Upload Logs if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: runtests-${{ runner.os }}-py${{ matrix.python-version }}-Salt${{ matrix.salt-version }}.log path: artifacts/runtests-*.log @@ -292,7 +291,7 @@ jobs: - name: Upload Exit Status if: always() - uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0 + uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 with: name: exitstatus-${{ github.job }}-Py${{ matrix.python-version }}-Salt${{ matrix.salt-version }} path: exitstatus diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 54faee3..91ddbd2 100755 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -59,9 +59,9 @@ repos: rev: 32151ac97cbfd7f9dcd22e49516fb32266db45b4 # v3.16.0 hooks: - id: pyupgrade - name: Rewrite Code to be Py3.8+ + name: Rewrite Code to be Py3.9+ args: [ - --py38-plus, + --py39-plus, ] exclude: src/saltext/vault/version.py @@ -70,25 +70,25 @@ repos: hooks: - id: isort args: [ - --py 38, + --py 39, ] exclude: src/saltext/vault/(__init__|version).py - repo: https://github.com/psf/black - rev: b965c2a5026f8ba399283ba3e01898b012853c79 # 24.8.0 + rev: 1b2427a2b785cc4aac97c19bb4b9a0de063f9547 # 24.10.0 hooks: - id: black args: [-l 100] exclude: src/saltext/vault/version.py - repo: https://github.com/adamchainz/blacken-docs - rev: 4c97c4a0d921007af6fefae92d8447cfbf63720b # 1.18.0 + rev: d4e2940d27621c7f20215459be05703947618b7b # 1.19.0 hooks: - id: blacken-docs args: [--skip-errors] files: ^(docs/.*\.rst|src/saltext/vault/.*\.py)$ additional_dependencies: - - black==24.8.0 + - black==24.10.0 # <---- Formatting ----------------------------------------------------------------------------- # ----- Security ------------------------------------------------------------------------------> @@ -123,8 +123,8 @@ repos: files: ^((setup|noxfile)|src/.*)\.py$ require_serial: true additional_dependencies: - - nox==2024.4.15 - - uv==0.4.18 # Makes this hook much faster + - nox==2024.10.9 + - uv==0.4.22 # Makes this hook much faster - id: nox alias: lint-tests @@ -134,8 +134,8 @@ repos: files: ^tests/.*\.py$ require_serial: true additional_dependencies: - - nox==2024.4.15 - - uv==0.4.18 # Makes this hook much faster + - nox==2024.10.9 + - uv==0.4.22 # Makes this hook much faster - repo: https://github.com/Mateusz-Grzelinski/actionlint-py rev: 27445053da613c660ed5895d9616662059a53ca7 # v1.7.3.17 diff --git a/.pylintrc b/.pylintrc index b304cb9..9891565 100755 --- a/.pylintrc +++ b/.pylintrc @@ -93,7 +93,7 @@ prefer-stubs=no # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.8 +py-version=3.9 # Discover python modules and packages in the file system subtree. recursive=no diff --git a/noxfile.py b/noxfile.py index a26a752..744321a 100755 --- a/noxfile.py +++ b/noxfile.py @@ -21,7 +21,7 @@ nox.options.default_venv_backend = "uv|virtualenv" # Python versions to test against -PYTHON_VERSIONS = ("3", "3.8", "3.9", "3.10") +PYTHON_VERSIONS = ("3", "3.9", "3.10") # Be verbose when running under a CI context CI_RUN = ( os.environ.get("JENKINS_URL") or os.environ.get("CI") or os.environ.get("DRONE") is not None @@ -30,7 +30,7 @@ SKIP_REQUIREMENTS_INSTALL = os.environ.get("SKIP_REQUIREMENTS_INSTALL", "0") == "1" EXTRA_REQUIREMENTS_INSTALL = os.environ.get("EXTRA_REQUIREMENTS_INSTALL") -COVERAGE_REQUIREMENT = os.environ.get("COVERAGE_REQUIREMENT") or "coverage==7.6.1" +COVERAGE_REQUIREMENT = os.environ.get("COVERAGE_REQUIREMENT") or "coverage==7.6.3" SALT_REQUIREMENT = os.environ.get("SALT_REQUIREMENT") or "salt>=3006" if SALT_REQUIREMENT == "salt==master": SALT_REQUIREMENT = "git+https://github.com/saltstack/salt.git@master" @@ -72,8 +72,8 @@ def _get_session_python_version_info(session): def _get_pydir(session): version_info = _get_session_python_version_info(session) - if version_info < (3, 8): - session.error("Only Python >= 3.8 is supported") + if version_info < (3, 9): + session.error("Only Python >= 3.9 is supported") return f"py{version_info[0]}.{version_info[1]}" diff --git a/pyproject.toml b/pyproject.toml index ac633a1..1c82184 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,14 +25,13 @@ classifiers = [ "Programming Language :: Cython", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", ] -requires-python = ">= 3.8" +requires-python = ">= 3.9" dynamic = ["version"] dependencies = [ "salt>=3006", diff --git a/src/saltext/vault/modules/vault_pki.py b/src/saltext/vault/modules/vault_pki.py index b790fc1..44cc7b4 100644 --- a/src/saltext/vault/modules/vault_pki.py +++ b/src/saltext/vault/modules/vault_pki.py @@ -1074,7 +1074,7 @@ def read_urls(mount="pki"): raise CommandExecutionError(f"{err.__class__}: {err}") from err -def _split_sans(sans) -> Tuple[list, list, list, list]: +def _split_sans(sans) -> tuple[list, list, list, list]: dns_sans = [] ip_sans = [] uri_sans = [] diff --git a/src/saltext/vault/utils/vault/pki.py b/src/saltext/vault/utils/vault/pki.py index 8d7eb55..5ba9149 100644 --- a/src/saltext/vault/utils/vault/pki.py +++ b/src/saltext/vault/utils/vault/pki.py @@ -141,7 +141,7 @@ def compare_cert_signing(current: cx509.Certificate, signing_ca: cx509.Certifica return changes -def compare_ca_chain(current: List[cx509.Certificate], new: List[cx509.Certificate]): +def compare_ca_chain(current: list[cx509.Certificate], new: list[cx509.Certificate]): if len(current) != len(new): return False for i, new_cert in enumerate(new): diff --git a/tests/conftest.py b/tests/conftest.py index 335014b..2dd9f8e 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -216,14 +216,17 @@ def sshd_server(salt_factories, sshd_config_dir): # pragma: no cover @pytest.fixture(scope="module") def known_hosts_file(sshd_server, master, salt_factories): # pragma: no cover - with pytest.helpers.temp_file( - "ssh-known-hosts", - "\n".join(sshd_server.get_host_keys()), - salt_factories.tmp_root_dir, - ) as known_hosts_file, pytest.helpers.temp_file( - "master.d/ssh-known-hosts.conf", - f"known_hosts_file: {known_hosts_file}", - master.config_dir, + with ( + pytest.helpers.temp_file( + "ssh-known-hosts", + "\n".join(sshd_server.get_host_keys()), + salt_factories.tmp_root_dir, + ) as known_hosts_file, + pytest.helpers.temp_file( + "master.d/ssh-known-hosts.conf", + f"known_hosts_file: {known_hosts_file}", + master.config_dir, + ), ): yield known_hosts_file diff --git a/tests/unit/runners/vault/test_vault.py b/tests/unit/runners/vault/test_vault.py index 5f75960..fd8b629 100644 --- a/tests/unit/runners/vault/test_vault.py +++ b/tests/unit/runners/vault/test_vault.py @@ -812,13 +812,17 @@ def test_generate_secret_id( expected.update(wrapped_serialized) else: expected["data"].update(secret_id_serialized) - with patch("saltext.vault.runners.vault._get_secret_id", autospec=True) as gen, patch( - "saltext.vault.runners.vault._approle_params_match", - autospec=True, - return_value=True, - ) as matcher, patch( - "saltext.vault.runners.vault._lookup_approle_cached", autospec=True - ) as lookup_approle: + with ( + patch("saltext.vault.runners.vault._get_secret_id", autospec=True) as gen, + patch( + "saltext.vault.runners.vault._approle_params_match", + autospec=True, + return_value=True, + ) as matcher, + patch( + "saltext.vault.runners.vault._lookup_approle_cached", autospec=True + ) as lookup_approle, + ): def res_or_wrap(*args, **kwargs): # pylint: disable=unused-argument if kwargs.get("wrap"): @@ -879,15 +883,18 @@ def test_generate_secret_id_updates_params( "misc_data": {"secret_id_num_uses": approle_meta["secret_id_num_uses"]}, "wrap_info": wrapped_serialized["wrap_info"], } - with patch("saltext.vault.runners.vault._get_secret_id", autospec=True) as gen, patch( - "saltext.vault.runners.vault._approle_params_match", - autospec=True, - return_value=False, - ) as matcher, patch( - "saltext.vault.runners.vault._manage_approle", autospec=True - ) as manage_approle, patch( - "saltext.vault.runners.vault._lookup_approle_cached", autospec=True - ) as lookup_approle: + with ( + patch("saltext.vault.runners.vault._get_secret_id", autospec=True) as gen, + patch( + "saltext.vault.runners.vault._approle_params_match", + autospec=True, + return_value=False, + ) as matcher, + patch("saltext.vault.runners.vault._manage_approle", autospec=True) as manage_approle, + patch( + "saltext.vault.runners.vault._lookup_approle_cached", autospec=True + ) as lookup_approle, + ): res = Mock(spec=vaultutil.VaultWrappedResponse) res.serialize_for_minion.return_value = wrapped_serialized gen.return_value = res diff --git a/tests/unit/utils/vault/test_api.py b/tests/unit/utils/vault/test_api.py index a481126..93ee240 100644 --- a/tests/unit/utils/vault/test_api.py +++ b/tests/unit/utils/vault/test_api.py @@ -249,12 +249,15 @@ def test_write_entity_alias(client, aliases, entity_fetch_response, identity_api if aliases[0]["mount_accessor"] == "test-accessor": payload["id"] = aliases[0]["id"] - with patch( - "saltext.vault.utils.vault.api.IdentityApi._lookup_mount_accessor", - return_value="test-accessor", - ), patch( - "saltext.vault.utils.vault.api.IdentityApi.read_entity", - return_value=entity_fetch_response["data"], + with ( + patch( + "saltext.vault.utils.vault.api.IdentityApi._lookup_mount_accessor", + return_value="test-accessor", + ), + patch( + "saltext.vault.utils.vault.api.IdentityApi.read_entity", + return_value=entity_fetch_response["data"], + ), ): identity_api.write_entity_alias( "salt_minion_test-minion", From c1497b508eab2bf3e9a732a9dd91d3c7a5adf876 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Thu, 17 Oct 2024 11:25:30 +0200 Subject: [PATCH 2/2] Remove unused typing imports --- src/saltext/vault/modules/vault_pki.py | 1 - src/saltext/vault/utils/vault/pki.py | 1 - 2 files changed, 2 deletions(-) diff --git a/src/saltext/vault/modules/vault_pki.py b/src/saltext/vault/modules/vault_pki.py index 44cc7b4..eeb30db 100644 --- a/src/saltext/vault/modules/vault_pki.py +++ b/src/saltext/vault/modules/vault_pki.py @@ -8,7 +8,6 @@ """ import logging -from typing import Tuple from salt.exceptions import CommandExecutionError from salt.exceptions import SaltInvocationError diff --git a/src/saltext/vault/utils/vault/pki.py b/src/saltext/vault/utils/vault/pki.py index 5ba9149..13bc26e 100644 --- a/src/saltext/vault/utils/vault/pki.py +++ b/src/saltext/vault/utils/vault/pki.py @@ -7,7 +7,6 @@ from datetime import datetime from datetime import timedelta from datetime import timezone -from typing import List import salt.utils.x509 as x509util from cryptography import x509 as cx509