diff options
Diffstat (limited to 'ansible_collections/cloud')
29 files changed, 378 insertions, 339 deletions
diff --git a/ansible_collections/cloud/common/.ansible-lint b/ansible_collections/cloud/common/.ansible-lint new file mode 100644 index 000000000..0c6729691 --- /dev/null +++ b/ansible_collections/cloud/common/.ansible-lint @@ -0,0 +1,8 @@ +--- +profile: production + +exclude_paths: + - tests/integration + - tests/sanity + - .github + - changelogs/changelog.yaml diff --git a/ansible_collections/cloud/common/.github/workflows/changelog.yml b/ansible_collections/cloud/common/.github/workflows/changelog.yaml index 40b5bccf9..21ed48ed6 100644 --- a/ansible_collections/cloud/common/.github/workflows/changelog.yml +++ b/ansible_collections/cloud/common/.github/workflows/changelog.yaml @@ -1,8 +1,7 @@ --- -name: CI - +name: Changelog concurrency: - group: changelog-${{ github.ref }} + group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true on: diff --git a/ansible_collections/cloud/common/.github/workflows/galaxy-import.yaml b/ansible_collections/cloud/common/.github/workflows/galaxy-import.yaml new file mode 100644 index 000000000..a3f6d29d1 --- /dev/null +++ b/ansible_collections/cloud/common/.github/workflows/galaxy-import.yaml @@ -0,0 +1,15 @@ +--- +name: galaxy-import +concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + +on: + pull_request: + branches: + - main + - stable-* + +jobs: + galaxy_importer: + uses: ansible-network/github_actions/.github/workflows/galaxy_importer.yml@main
\ No newline at end of file diff --git a/ansible_collections/cloud/common/.github/workflows/integration-tests-kubernetes-core.yaml b/ansible_collections/cloud/common/.github/workflows/integration-tests-kubernetes-core.yaml new file mode 100644 index 000000000..a9eb22ad5 --- /dev/null +++ b/ansible_collections/cloud/common/.github/workflows/integration-tests-kubernetes-core.yaml @@ -0,0 +1,141 @@ +--- +name: Integration tests +on: + pull_request: + branches: + - main + - stable-* + +jobs: + splitter: + env: + source_dir: "./source" + runs-on: ubuntu-latest + outputs: + test_targets: ${{ steps.splitter.outputs.test_targets }} + test_targets_json: ${{ steps.splitter.outputs.test_targets_json }} + test_jobs: ${{ steps.splitter.outputs.test_jobs }} + steps: + - name: Checkout the collection repository + uses: actions/checkout@v3 + with: + repository: ansible-collections/kubernetes.core + ref: main + path: ${{ env.source_dir }} + fetch-depth: "0" + + - name: Split all Kubernetes targets into Job + id: splitter + uses: ansible-network/github_actions/.github/actions/ansible_test_splitter@main + with: + collections_to_test: ${{ env.source_dir }} + total_jobs: 8 + env: + ANSIBLE_TEST_ALL_THE_TARGETS: "true" + + - name: Display splitter output + run: | + echo "test_targets=${{ steps.splitter.outputs.test_targets }}" + echo "test_targets_json=${{ steps.splitter.outputs.test_targets_json }}" + echo "test_jobs=${{ steps.splitter.outputs.test_jobs }}" + shell: bash + integration: + runs-on: ubuntu-latest + timeout-minutes: 60 + needs: + - splitter + if: ${{ needs.splitter.outputs.test_targets != '' }} + env: + source: "./cloud_common" + ansible_posix: "./ansible_posix" + kubernetes_core: "./kubernetes_core" + strategy: + fail-fast: false + matrix: + ansible-version: + - milestone + python-version: + - "3.12" + workflow-id: ${{ fromJson(needs.splitter.outputs.test_jobs) }} + name: "integration-kubernetes-core-${{ matrix.python-version }}-${{ matrix.ansible-version }}-${{ matrix.workflow-id }}" + steps: + - name: Read target + id: read-targets + run: | + import json, os + with open(os.environ.get('GITHUB_OUTPUT'), "a", encoding="utf-8") as fh: + fh.write(f'ansible_test_targets={json.loads(os.environ.get("ALL_TEST_TARGETS")).get(os.environ.get("WORKFLOW_ID"))}\n') + shell: python + env: + ALL_TEST_TARGETS: ${{ needs.splitter.outputs.test_targets_json }} + WORKFLOW_ID: ${{ matrix.workflow-id }} + + - name: Display ansible test targets + run: | + echo "ansible_test_targets -> ${{ steps.read-targets.outputs.ansible_test_targets }}" + shell: bash + + - name: Checkout cloud.common repository + uses: actions/checkout@v3 + with: + path: ${{ env.source }} + ref: ${{ github.event.pull_request.head.sha }} + + - name: checkout ansible-collections/kubernetes.core + uses: ansible-network/github_actions/.github/actions/checkout_dependency@main + with: + repository: ansible-collections/kubernetes.core + path: ${{ env.kubernetes_core }} + ref: main + + - name: checkout ansible-collections/ansible.posix + uses: ansible-network/github_actions/.github/actions/checkout_dependency@main + with: + repository: ansible-collections/ansible.posix + path: ${{ env.ansible_posix }} + ref: main + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + # install ansible + - name: Install ansible-core (${{ matrix.ansible-version }}) + run: >- + python3 -m pip install + https://github.com/ansible/ansible/archive/${{ matrix.ansible-version }}.tar.gz + --disable-pip-version-check + shell: bash + + - name: Build and install kuernetes.core collection + id: install-kubernetes-core + uses: ansible-network/github_actions/.github/actions/build_install_collection@main + with: + install_python_dependencies: true + source_path: ${{ env.kubernetes_core }} + + - name: install cloud.common collection + uses: ansible-network/github_actions/.github/actions/build_install_collection@main + with: + install_python_dependencies: true + source_path: ${{ env.source }} + + - name: install ansible.posix collection + uses: ansible-network/github_actions/.github/actions/build_install_collection@main + with: + install_python_dependencies: true + source_path: ${{ env.ansible_posix }} + + - name: Create kubernetes cluster + uses: helm/kind-action@v1.4.0 + + - name: Run integration tests + uses: ansible-network/github_actions/.github/actions/ansible_test_integration@main + with: + collection_path: ${{ steps.install-kubernetes-core.outputs.collection_path }} + python_version: ${{ matrix.python-version }} + ansible_version: ${{ matrix.ansible-version }} + ansible_test_targets: ${{ steps.read-targets.outputs.ansible_test_targets }} + ansible_test_environment: | + ENABLE_TURBO_MODE=true
\ No newline at end of file diff --git a/ansible_collections/cloud/common/.github/workflows/linters.yaml b/ansible_collections/cloud/common/.github/workflows/linters.yaml new file mode 100644 index 000000000..5c74d3b36 --- /dev/null +++ b/ansible_collections/cloud/common/.github/workflows/linters.yaml @@ -0,0 +1,25 @@ +--- +name: Linters +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + branches: + - main + - stable-* + tags: + - '*' + +jobs: + linters: + uses: ansible-network/github_actions/.github/workflows/tox-linters.yml@main + + ansible-lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Run ansible-lint + uses: ansible/ansible-lint@v6.21.0
\ No newline at end of file diff --git a/ansible_collections/cloud/common/.github/workflows/linters.yml b/ansible_collections/cloud/common/.github/workflows/linters.yml deleted file mode 100644 index cafab80ae..000000000 --- a/ansible_collections/cloud/common/.github/workflows/linters.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -name: CI - -concurrency: - group: linters-${{ github.ref }} - cancel-in-progress: true - -on: # yamllint disable-line rule:truthy - pull_request: - branches: - - main - - stable-* - -jobs: - linters: - uses: ansible-network/github_actions/.github/workflows/tox-linters.yml@main
\ No newline at end of file diff --git a/ansible_collections/cloud/common/.github/workflows/sanity-tests.yaml b/ansible_collections/cloud/common/.github/workflows/sanity-tests.yaml new file mode 100644 index 000000000..e3a813060 --- /dev/null +++ b/ansible_collections/cloud/common/.github/workflows/sanity-tests.yaml @@ -0,0 +1,15 @@ +--- +name: Sanity tests +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + branches: + - main + - stable-* + +jobs: + sanity: + uses: ansible-network/github_actions/.github/workflows/sanity.yml@main
\ No newline at end of file diff --git a/ansible_collections/cloud/common/.github/workflows/sanity_and_units.yml b/ansible_collections/cloud/common/.github/workflows/sanity_and_units.yml deleted file mode 100644 index c2cc86756..000000000 --- a/ansible_collections/cloud/common/.github/workflows/sanity_and_units.yml +++ /dev/null @@ -1,172 +0,0 @@ ---- -name: CI - -concurrency: - group: sanity-units-${{ github.ref }} - cancel-in-progress: true - -on: # yamllint disable-line rule:truthy - pull_request: - branches: - - main - - stable-* - schedule: - - cron: '0 14 * * 1' - -jobs: - sanity: - uses: ansible-network/github_actions/.github/workflows/sanity.yml@main - with: - matrix_include: "[]" - matrix_exclude: >- - [ - { - "ansible-version": "stable-2.9", - "python-version": "3.9" - }, - { - "ansible-version": "stable-2.9", - "python-version": "3.10" - }, - { - "ansible-version": "stable-2.9", - "python-version": "3.11" - }, - { - "ansible-version": "stable-2.12", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.12", - "python-version": "3.11" - }, - { - "ansible-version": "stable-2.13", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.13", - "python-version": "3.11" - }, - { - "ansible-version": "stable-2.14", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.14", - "python-version": "3.8" - }, - { - "ansible-version": "stable-2.15", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.15", - "python-version": "3.8" - }, - { - "ansible-version": "milestone", - "python-version": "3.7" - }, - { - "ansible-version": "milestone", - "python-version": "3.8" - }, - { - "ansible-version": "milestone", - "python-version": "3.9" - }, - { - "ansible-version": "devel", - "python-version": "3.7" - }, - { - "ansible-version": "devel", - "python-version": "3.8" - }, - { - "ansible-version": "devel", - "python-version": "3.9" - } - ] - unit-source: - # Runs on ansible-2.12+ - uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main - with: - matrix_exclude: >- - [ - { - "python-version": "3.11" - }, - { - "ansible-version": "stable-2.12", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.13", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.12", - "python-version": "3.8" - }, - { - "ansible-version": "stable-2.13", - "python-version": "3.8" - }, - { - "ansible-version": "stable-2.14", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.14", - "python-version": "3.8" - }, - { - "ansible-version": "stable-2.15", - "python-version": "3.7" - }, - { - "ansible-version": "stable-2.15", - "python-version": "3.8" - }, - { - "ansible-version": "milestone", - "python-version": "3.7" - }, - { - "ansible-version": "milestone", - "python-version": "3.8" - }, - { - "ansible-version": "milestone", - "python-version": "3.9" - }, - { - "ansible-version": "devel", - "python-version": "3.7" - }, - { - "ansible-version": "devel", - "python-version": "3.8" - }, - { - "ansible-version": "devel", - "python-version": "3.9" - } - ] - collection_pre_install: '' - all_green: - if: ${{ always() }} - needs: - - sanity - - unit-source - runs-on: ubuntu-latest - steps: - - run: >- - python -c "assert set([ - '${{ needs.unit-source.result }}' - ]) == {'success'}" - - run: >- - python -c "assert '${{ needs.sanity.result }}' - in ['success', 'failure']" diff --git a/ansible_collections/cloud/common/.github/workflows/unit-ansible-2.9.yml b/ansible_collections/cloud/common/.github/workflows/unit-ansible-2.9.yml deleted file mode 100644 index 779d5474d..000000000 --- a/ansible_collections/cloud/common/.github/workflows/unit-ansible-2.9.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: CI - -concurrency: - group: units-29-${{ github.ref }} - cancel-in-progress: true - -on: # yamllint disable-line rule:truthy - push: - branches: - - main - - stable-* - pull_request: - branches: - - main - - stable-* - schedule: - - cron: '0 14 * * 1' - -jobs: - units: - runs-on: ubuntu-20.04 - name: unit-2.9 - env: - ansible_version: stable-2.9 - python_version: 3.7 - steps: - - name: Checkout the collection repository - uses: ansible-network/github_actions/.github/actions/checkout_dependency@main - with: - path: ${{ env.source_directory }} - - - name: Set up Python ${{ env.python_version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ env.python_version }} - - - name: Install ansible-core (${{ env.ansible_version }}) - run: python3 -m pip install https://github.com/ansible/ansible/archive/${{ env.ansible_version }}.tar.gz --disable-pip-version-check - - - name: Read collection metadata from galaxy.yml - id: identify - uses: ansible-network/github_actions/.github/actions/identify_collection@main - with: - source_path: ${{ env.source_directory }} - - - name: Build and install the collection - uses: ansible-network/github_actions/.github/actions/build_install_collection@main - with: - install_python_dependencies: true - source_path: ${{ env.source_directory }} - collection_path: ${{ steps.identify.outputs.collection_path }} - tar_file: ${{ steps.identify.outputs.tar_file }} - ansible_version: "${{ env.ansible_version }}" - - - name: Print the ansible version - run: ansible --version - - - name: Print the python dependencies - run: python3 -m pip list - - - name: Run unit tests - run: python -m pytest tests/unit --showlocals - working-directory: ${{ steps.identify.outputs.collection_path }} diff --git a/ansible_collections/cloud/common/.github/workflows/unit-tests.yaml b/ansible_collections/cloud/common/.github/workflows/unit-tests.yaml new file mode 100644 index 000000000..0cb2f1892 --- /dev/null +++ b/ansible_collections/cloud/common/.github/workflows/unit-tests.yaml @@ -0,0 +1,15 @@ +--- +name: Unit tests +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +on: + pull_request: + branches: + - main + - stable-* + +jobs: + unit-source: + uses: ansible-network/github_actions/.github/workflows/unit_source.yml@main
\ No newline at end of file diff --git a/ansible_collections/cloud/common/CHANGELOG.rst b/ansible_collections/cloud/common/CHANGELOG.rst index 95285f7e2..c48dc6486 100644 --- a/ansible_collections/cloud/common/CHANGELOG.rst +++ b/ansible_collections/cloud/common/CHANGELOG.rst @@ -5,6 +5,20 @@ cloud.common Release Notes .. contents:: Topics +v3.0.0 +====== + +Release Summary +--------------- + +This major release drops support for ansible-core versions lower than 2.14 and Python versions lower than 3.9. + +Breaking Changes / Porting Guide +-------------------------------- + +- Bump minimum Python supported version to 3.9. +- Remove support for ansible-core < 2.14. + v2.1.4 ====== diff --git a/ansible_collections/cloud/common/FILES.json b/ansible_collections/cloud/common/FILES.json index a23528a12..29eab6109 100644 --- a/ansible_collections/cloud/common/FILES.json +++ b/ansible_collections/cloud/common/FILES.json @@ -22,31 +22,45 @@ "format": 1 }, { - "name": ".github/workflows/changelog.yml", + "name": ".github/workflows/changelog.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "15ef7af9b356986f0ecad4c9b251c8bfb88d4e40ad2ff1ae9e23127df0be8a29", + "chksum_sha256": "d79e90d491c634f11cb0c90b343a543544c5d0069b66ff973db4cf9dfd1a69ae", "format": 1 }, { - "name": ".github/workflows/linters.yml", + "name": ".github/workflows/galaxy-import.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "53ea8cad53e067156aa4bdd432fc05371d3c4e8e82b06ad77d42bed22ac165e1", + "chksum_sha256": "cfdc3943bfd350aafb21a8302e00f258be92e7e8814a0d38d6b2e2509fa7424d", "format": 1 }, { - "name": ".github/workflows/sanity_and_units.yml", + "name": ".github/workflows/integration-tests-kubernetes-core.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ff67be1c0f4fbfa795ca723ca75c5339d3c641206828a2bd1a0d2a683d753a92", + "chksum_sha256": "3180ac91513fe29c13a4d8e5ceaaf16ac17b6d66dbc1082905d4852ec949161a", "format": 1 }, { - "name": ".github/workflows/unit-ansible-2.9.yml", + "name": ".github/workflows/linters.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6da10d31e601196c276d4e14f66499beb0f1f55208eb8e71d00fc3b600d82dfa", + "chksum_sha256": "531ddd71a6d54968db38885ced1ad449fd7cfa5e1199d964930c8c9098075eeb", + "format": 1 + }, + { + "name": ".github/workflows/sanity-tests.yaml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "37ddc7e3759d5301ba36f07850cbdb8b57be08e4d3cd00cabb213b7ceda6df1a", + "format": 1 + }, + { + "name": ".github/workflows/unit-tests.yaml", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "ed9f251f4839069f01c8ce39aa6f26ab588c53c033745ec8201e6a9a494049eb", "format": 1 }, { @@ -74,14 +88,14 @@ "name": "changelogs/changelog.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ad23e3b397d21ce7df780bbb5d5eab1297b3ac88973cec18e0371ab60d6b6ffb", + "chksum_sha256": "f2f85521f8cd85c3c60c6da2cf089304cb78d121d72bf31de15a3fed3b8c6fe8", "format": 1 }, { "name": "changelogs/config.yaml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "8ed2dc9b735615a898401d871695d090d74624a617d80f7bde0b59abd79fae6e", + "chksum_sha256": "2308bb8bfb8dc1b7092ff7f8c200741cbc09ed16d5826e0c4e03b3eaff1bba1e", "format": 1 }, { @@ -95,7 +109,7 @@ "name": "meta/runtime.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "535568680e7ecac4940996890d5c31e4b43aa1bfe90452610902fade3e8b1521", + "chksum_sha256": "4833e2900333e7a035d7e0f63f6d55777c2697476ee0a2f9bfcf250167c7571d", "format": 1 }, { @@ -116,7 +130,7 @@ "name": "plugins/lookup/turbo_demo.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "36a1cac200d74a970d78687b8ce86c3e18c201f6bb4d9da7d1c4b5448f822eda", + "chksum_sha256": "0aab0a3a5b2f39be78c9b3be466c42637b75a6c6a7da8483b6765a6891cedb6d", "format": 1 }, { @@ -137,7 +151,7 @@ "name": "plugins/module_utils/turbo/common.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "0cb8fa84023f04361a4e2c4fc87ab381e5b238772ab34ec0b258a0fcc2868e14", + "chksum_sha256": "8341ffad8a1d4dd96c3584646f0d38eec7c47caa678eca4a582b1e4938391c59", "format": 1 }, { @@ -151,14 +165,14 @@ "name": "plugins/module_utils/turbo/module.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "4489bf197e29debb7b46d3ebbd306e5feec859a94f7f18ff87f73b15fe562801", + "chksum_sha256": "130af918b12ad53df7158c5d56f8a222af029c577170d4352f06e326c5e762a0", "format": 1 }, { "name": "plugins/module_utils/turbo/server.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "9de1df379e205f0e9be29cba7480aadfb00c9ed164e9d29de0f5200bfb1874d2", + "chksum_sha256": "1303dc84dda62ae268ed4ca1d50c9012566b17f5db0aa32019ef4da26199a27a", "format": 1 }, { @@ -186,7 +200,7 @@ "name": "plugins/modules/turbo_fail.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "a2a80de946f0b687e6b2182c74a467279e87009a5aadbf5344ce7412ca94fce1", + "chksum_sha256": "5d3fa60223660cb593204aea0dd000698e7f529f95b4122d39347749ab869001", "format": 1 }, { @@ -214,7 +228,7 @@ "name": "plugins/plugin_utils/turbo/lookup.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "ddd2a780197cf8c3540c9a831b91b74ba40b566345e122ed2f15faeaa44967eb", + "chksum_sha256": "b3d083533f54f550238857bbbe39d655a9474d1e996553dc7049e0c3584afd54", "format": 1 }, { @@ -400,6 +414,13 @@ "format": 1 }, { + "name": "tests/sanity/ignore-2.17.txt", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "6ade72ead3ea9bfa27bc079c9f4f9dddc8fc29e3e5ae5cabb2e2e7666317485e", + "format": 1 + }, + { "name": "tests/sanity/ignore-2.9.txt", "ftype": "file", "chksum_type": "sha256", @@ -438,21 +459,21 @@ "name": "tests/unit/plugins/module_utils/turbo/conftest.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "99a3352cf6215e0a3d767c048fbfefa66aec5cead1330b0b029975e019faeb8c", + "chksum_sha256": "997a8268b74ac7460a1e39daeb7b2f978524fc07d70993d156292448a7cdf121", "format": 1 }, { "name": "tests/unit/plugins/module_utils/turbo/test_module.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "5b7ed86bd31bd4bf172cf9e8b6d1c8715bd0d6128713e6b59418b55ad33ad417", + "chksum_sha256": "351f4ad8a805a46d6e11bcfe96b1c5401992e6a40621f38f276fb4f05e27c2ca", "format": 1 }, { "name": "tests/unit/plugins/module_utils/turbo/test_turbo_module.py", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "6ec409210b6c84bc4418771ffa6a5543742dc78e710246405bd17a9bc7326850", + "chksum_sha256": "f49b4ec56f820203d6deec10381b40c9380bae608d181d1eef0909d3a4e166e0", "format": 1 }, { @@ -466,14 +487,21 @@ "name": "tests/config.yml", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "232da28b965d5e057d65173ffa9e4f3d63c87b537001450bcb033199309d16ae", + "chksum_sha256": "8bbb85dbed589969d508c46298ad61fdedee8fad8ffc34599f6acf75b968b75d", + "format": 1 + }, + { + "name": ".ansible-lint", + "ftype": "file", + "chksum_type": "sha256", + "chksum_sha256": "85ca041c12994aa38be955f3a2d0e82103bb29820699a197d82acac379508a47", "format": 1 }, { "name": "CHANGELOG.rst", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "37e82a484e32691dd70a237e28b0eb0300cb77d98aaa48a1380f9698a156be40", + "chksum_sha256": "fbab623a1c59e912ead2d686731932617801d94eacec8de130fd1c0961cfd12e", "format": 1 }, { @@ -494,7 +522,7 @@ "name": "README.md", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "77bab797767ac83a7a73e0314aea2370f5a3c5cee2d220c7dcd55ac7513486a1", + "chksum_sha256": "30cfbc272568ad7f90b59b57fdb532f79d2520397fd5e1a8c7f82cfa01f1cbf0", "format": 1 }, { @@ -529,7 +557,7 @@ "name": "tox.ini", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "e318271cca12b953614d48cd35f887f92fb7463fdeb0a143c445cc34948246f0", + "chksum_sha256": "ff9067a4b379b1d44c8f44c158276563c1e752495d9689c319e3e158143fbce0", "format": 1 } ], diff --git a/ansible_collections/cloud/common/MANIFEST.json b/ansible_collections/cloud/common/MANIFEST.json index caed94f54..42bb48e59 100644 --- a/ansible_collections/cloud/common/MANIFEST.json +++ b/ansible_collections/cloud/common/MANIFEST.json @@ -2,7 +2,7 @@ "collection_info": { "namespace": "cloud", "name": "common", - "version": "2.1.4", + "version": "3.0.0", "authors": [ "Ansible (https://github.com/ansible)" ], @@ -24,7 +24,7 @@ "name": "FILES.json", "ftype": "file", "chksum_type": "sha256", - "chksum_sha256": "272fd687d00aee319c1ee38dfe287bf5aa9bd45eebe0f550ff61e294e7afcb8e", + "chksum_sha256": "9039143a606bdc887a65831ff7f3db6ee6e3aa34151dba0b3b5454d806717868", "format": 1 }, "format": 1 diff --git a/ansible_collections/cloud/common/README.md b/ansible_collections/cloud/common/README.md index ce1fcede9..42debccdc 100644 --- a/ansible_collections/cloud/common/README.md +++ b/ansible_collections/cloud/common/README.md @@ -8,7 +8,7 @@ More content may be included later. # Requirements -- ansible_turbo.module requires Python 3.6 and Ansible 2.13.0 or greater. +- ansible_turbo.module requires Python 3.9 and Ansible 2.14.0 or greater. ## Ansible Turbo Module diff --git a/ansible_collections/cloud/common/changelogs/changelog.yaml b/ansible_collections/cloud/common/changelogs/changelog.yaml index 4ca93cad3..96eaa9707 100644 --- a/ansible_collections/cloud/common/changelogs/changelog.yaml +++ b/ansible_collections/cloud/common/changelogs/changelog.yaml @@ -156,3 +156,15 @@ releases: - release_summary.yml - update_ansible_version.yml release_date: '2023-08-14' + 3.0.0: + changes: + breaking_changes: + - Bump minimum Python supported version to 3.9. + - Remove support for ansible-core < 2.14. + release_summary: This major release drops support for ansible-core versions lower + than 2.14 and Python versions lower than 3.9. + fragments: + - 20231114-ansible-version.yml + - organize_github_actions.yaml + - release_summary.yml + release_date: '2023-11-16' diff --git a/ansible_collections/cloud/common/changelogs/config.yaml b/ansible_collections/cloud/common/changelogs/config.yaml index 6b49df020..d95a02590 100644 --- a/ansible_collections/cloud/common/changelogs/config.yaml +++ b/ansible_collections/cloud/common/changelogs/config.yaml @@ -9,21 +9,21 @@ notesdir: fragments prelude_section_name: release_summary prelude_section_title: Release Summary sections: -- - major_changes - - Major Changes -- - minor_changes - - Minor Changes -- - breaking_changes - - Breaking Changes / Porting Guide -- - deprecated_features - - Deprecated Features -- - removed_features - - Removed Features (previously deprecated) -- - security_fixes - - Security Fixes -- - bugfixes - - Bugfixes -- - known_issues - - Known Issues + - - major_changes + - Major Changes + - - minor_changes + - Minor Changes + - - breaking_changes + - Breaking Changes / Porting Guide + - - deprecated_features + - Deprecated Features + - - removed_features + - Removed Features (previously deprecated) + - - security_fixes + - Security Fixes + - - bugfixes + - Bugfixes + - - known_issues + - Known Issues title: cloud.common trivial_section_name: trivial diff --git a/ansible_collections/cloud/common/meta/runtime.yml b/ansible_collections/cloud/common/meta/runtime.yml index 873e7979a..be99ccf4b 100644 --- a/ansible_collections/cloud/common/meta/runtime.yml +++ b/ansible_collections/cloud/common/meta/runtime.yml @@ -1,2 +1,2 @@ --- -requires_ansible: '>=2.13.0' +requires_ansible: '>=2.14.0' diff --git a/ansible_collections/cloud/common/plugins/lookup/turbo_demo.py b/ansible_collections/cloud/common/plugins/lookup/turbo_demo.py index 88778cd67..4d69b0d01 100644 --- a/ansible_collections/cloud/common/plugins/lookup/turbo_demo.py +++ b/ansible_collections/cloud/common/plugins/lookup/turbo_demo.py @@ -44,7 +44,7 @@ if True: # pylint: disable=using-constant-test async def execute(terms, variables, playbook_vars): result = [] - result.append("running from pid: {pid}".format(pid=os.getpid())) + result.append(f"running from pid: {os.getpid()}") if playbook_vars is not None: result += [ variables["vars"].get(x) for x in playbook_vars if x in variables["vars"] @@ -57,7 +57,7 @@ async def execute(terms, variables, playbook_vars): if fname == __file__: continue - result.append("turbo_demo_counter: {0}".format(counter())) + result.append(f"turbo_demo_counter: {counter()}") return result diff --git a/ansible_collections/cloud/common/plugins/module_utils/turbo/common.py b/ansible_collections/cloud/common/plugins/module_utils/turbo/common.py index e5ad19383..ebe9b0c2a 100644 --- a/ansible_collections/cloud/common/plugins/module_utils/turbo/common.py +++ b/ansible_collections/cloud/common/plugins/module_utils/turbo/common.py @@ -25,18 +25,16 @@ # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE # USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # +import json import os +import pickle import socket +import subprocess import sys import time -import subprocess -import pickle from contextlib import contextmanager -import json -from .exceptions import ( - EmbeddedModuleUnexpectedFailure, -) +from .exceptions import EmbeddedModuleUnexpectedFailure class AnsibleTurboSocket: @@ -107,7 +105,7 @@ class AnsibleTurboSocket: return result except json.decoder.JSONDecodeError: raise EmbeddedModuleUnexpectedFailure( - "Cannot decode plugin answer: {0}".format(raw_answer) + f"Cannot decode plugin answer: {raw_answer}" ) def close(self): diff --git a/ansible_collections/cloud/common/plugins/module_utils/turbo/module.py b/ansible_collections/cloud/common/plugins/module_utils/turbo/module.py index c2f9d667e..64b9fba42 100644 --- a/ansible_collections/cloud/common/plugins/module_utils/turbo/module.py +++ b/ansible_collections/cloud/common/plugins/module_utils/turbo/module.py @@ -32,12 +32,10 @@ import sys import tempfile import ansible.module_utils.basic -from .exceptions import ( - EmbeddedModuleSuccess, - EmbeddedModuleFailure, -) import ansible_collections.cloud.common.plugins.module_utils.turbo.common +from .exceptions import EmbeddedModuleFailure, EmbeddedModuleSuccess + if False: # pylint: disable=using-constant-test from .server import please_include_me diff --git a/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py b/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py index 04ddf67f3..2769580b4 100644 --- a/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py +++ b/ansible_collections/cloud/common/plugins/module_utils/turbo/server.py @@ -27,31 +27,30 @@ # import argparse import asyncio -from datetime import datetime + +# py38 only, See: https://github.com/PyCQA/pylint/issues/2976 +import collections # pylint: disable=syntax-error import importlib # py38 only, See: https://github.com/PyCQA/pylint/issues/2976 import inspect # pylint: disable=syntax-error import io import json - -# py38 only, See: https://github.com/PyCQA/pylint/issues/2976 -import collections # pylint: disable=syntax-error import os +import pickle import signal import sys import traceback +import uuid import zipfile +from datetime import datetime from zipimport import zipimporter -import pickle -import uuid sys_path_lock = None env_lock = None import ansible.module_utils.basic - please_include_me = "bar" @@ -180,8 +179,8 @@ class EmbeddedModule: from .exceptions import ( EmbeddedModuleFailure, - EmbeddedModuleUnexpectedFailure, EmbeddedModuleSuccess, + EmbeddedModuleUnexpectedFailure, ) # monkeypatching to pass the argument to the module, this is not diff --git a/ansible_collections/cloud/common/plugins/modules/turbo_fail.py b/ansible_collections/cloud/common/plugins/modules/turbo_fail.py index 76be87160..eae1ce2a2 100644 --- a/ansible_collections/cloud/common/plugins/modules/turbo_fail.py +++ b/ansible_collections/cloud/common/plugins/modules/turbo_fail.py @@ -28,7 +28,7 @@ EXAMPLES = r""" - name: Fail with additional arguments cloud.common.turbo_fail: params: - test: "ansible" + test: "ansible" """ diff --git a/ansible_collections/cloud/common/plugins/plugin_utils/turbo/lookup.py b/ansible_collections/cloud/common/plugins/plugin_utils/turbo/lookup.py index 627f665fc..d0cc6d862 100644 --- a/ansible_collections/cloud/common/plugins/plugin_utils/turbo/lookup.py +++ b/ansible_collections/cloud/common/plugins/plugin_utils/turbo/lookup.py @@ -27,8 +27,8 @@ import os -from ansible.plugins.lookup import LookupBase import ansible_collections.cloud.common.plugins.module_utils.turbo.common +from ansible.plugins.lookup import LookupBase from ansible_collections.cloud.common.plugins.module_utils.turbo.exceptions import ( EmbeddedModuleUnexpectedFailure, ) @@ -75,9 +75,9 @@ class TurboLookupBase(LookupBase): if idx != -1: name = name[:idx] - self.__socket_path = os.environ[ - "HOME" - ] + "/.ansible/tmp/turbo_lookup.{0}.socket".format(name) + self.__socket_path = ( + os.environ["HOME"] + f"/.ansible/tmp/turbo_lookup.{name}.socket" + ) return self.__socket_path def execute(self, terms, variables=None, **kwargs): diff --git a/ansible_collections/cloud/common/tests/config.yml b/ansible_collections/cloud/common/tests/config.yml index faff92e33..05012468b 100644 --- a/ansible_collections/cloud/common/tests/config.yml +++ b/ansible_collections/cloud/common/tests/config.yml @@ -1,2 +1,2 @@ modules: - python_requires: '>=3.6' + python_requires: '>=3.9' diff --git a/ansible_collections/cloud/common/tests/sanity/ignore-2.17.txt b/ansible_collections/cloud/common/tests/sanity/ignore-2.17.txt new file mode 100644 index 000000000..e7b94a256 --- /dev/null +++ b/ansible_collections/cloud/common/tests/sanity/ignore-2.17.txt @@ -0,0 +1 @@ +plugins/module_utils/turbo/server.py pylint:ansible-bad-module-import diff --git a/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/conftest.py b/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/conftest.py index 8f8f44e78..0b7006b27 100644 --- a/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/conftest.py +++ b/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/conftest.py @@ -6,7 +6,6 @@ import json import pytest - from ansible.module_utils import basic from ansible.module_utils.common.text.converters import to_bytes diff --git a/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/test_module.py b/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/test_module.py index 61a02e145..ecfb1d60f 100644 --- a/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/test_module.py +++ b/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/test_module.py @@ -6,7 +6,6 @@ import sys import pytest - from ansible_collections.cloud.common.plugins.module_utils.turbo.module import ( AnsibleTurboModule, ) diff --git a/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/test_turbo_module.py b/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/test_turbo_module.py index 6401046a0..1d24d9b60 100644 --- a/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/test_turbo_module.py +++ b/ansible_collections/cloud/common/tests/unit/plugins/module_utils/turbo/test_turbo_module.py @@ -3,22 +3,24 @@ # GNU General Public License v3.0+ # (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) -# py38 only, See: https://github.com/PyCQA/pylint/issues/2976 -from unittest.mock import Mock, ANY # pylint: disable=syntax-error -import time -import pytest +import os import socket import subprocess -import os -import ansible.module_utils.basic -from pathlib import Path import sys +import time +from pathlib import Path + +# py38 only, See: https://github.com/PyCQA/pylint/issues/2976 +from unittest.mock import ANY, Mock # pylint: disable=syntax-error + +import ansible.module_utils.basic +import ansible_collections.cloud.common.plugins.module_utils.turbo.common as turbo_common +import pytest from ansible_collections.cloud.common.plugins.module_utils.turbo.module import ( - get_collection_name_from_path, expand_argument_specs_aliases, + get_collection_name_from_path, prepare_args, ) -import ansible_collections.cloud.common.plugins.module_utils.turbo.common as turbo_common @pytest.mark.parametrize( diff --git a/ansible_collections/cloud/common/tox.ini b/ansible_collections/cloud/common/tox.ini index db838f25d..ecb7669df 100644 --- a/ansible_collections/cloud/common/tox.ini +++ b/ansible_collections/cloud/common/tox.ini @@ -3,25 +3,47 @@ minversion = 1.4.2 envlist = linters skipsdist = True +[common] + +format_dirs = {toxinidir}/plugins {toxinidir}/tests + [testenv] deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt install_command = pip install {opts} {packages} +[testenv:isort] +deps = + isort +commands = + isort --profile black {[common]format_dirs} + +[testenv:flynt] +deps = + flynt +commands = + flynt {[common]format_dirs} + [testenv:black] +depends = + flynt, isort deps = black >=23.0, <24.0 commands = - black {toxinidir}/plugins {toxinidir}/tests/unit/ + black {[common]format_dirs} [testenv:linters] install_command = pip install {opts} {packages} deps = {[testenv:black]deps} + {[testenv:isort]deps} + {[testenv:flynt]deps} flake8 commands = - black -v --check {toxinidir}/plugins {toxinidir}/tests/unit/ - flake8 {posargs} {toxinidir}/plugins {toxinidir}/tests/unit/ + flynt {[common]format_dirs} + isort --profile black {[common]format_dirs} + black -v --check {[common]format_dirs} + flake8 {posargs} {[common]format_dirs} [flake8] # E123, E125 skipped as they are invalid PEP-8. |