From acbb59d3d8e8562940a5054cbb8561136e154f83 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 2 Jun 2025 20:10:42 +0200 Subject: [PATCH] Add changes by russoz (#10192) * remove references/test for ansible-core<2.16 * Add/update changelog fragment. * Undo change to ansible_galaxy_install. * Remove unnecessary import. --------- Co-authored-by: Alexei Znamensky --- changelogs/fragments/ansible-core-support.yml | 3 ++- plugins/lookup/dependent.py | 1 - plugins/modules/maven_artifact.py | 6 +----- .../integration/targets/filter_lists_mergeby/tasks/main.yml | 3 +-- tests/integration/targets/kernel_blacklist/tasks/main.yml | 2 +- tests/integration/targets/test_a_module/runme.yml | 1 - tests/utils/shippable/shippable.sh | 6 ++---- 7 files changed, 7 insertions(+), 15 deletions(-) diff --git a/changelogs/fragments/ansible-core-support.yml b/changelogs/fragments/ansible-core-support.yml index 074acf00fa..295cd6f113 100644 --- a/changelogs/fragments/ansible-core-support.yml +++ b/changelogs/fragments/ansible-core-support.yml @@ -1,7 +1,8 @@ removed_features: - - "Dropped support for ansible-core 2.15. The collection now requires ansible-core 2.16 or newer. This means that on the controller, Python 3.10+ is required. On the target side, Python 2.7 and Python 3.6+ are supported (https://github.com/ansible-collections/community.general/pull/10160)." + - "Dropped support for ansible-core 2.15. The collection now requires ansible-core 2.16 or newer. This means that on the controller, Python 3.10+ is required. On the target side, Python 2.7 and Python 3.6+ are supported (https://github.com/ansible-collections/community.general/pull/10160, https://github.com/ansible-collections/community.general/pull/10192)." minor_changes: - "cartesian lookup plugin - removed compatibility code for ansible-core < 2.14 (https://github.com/ansible-collections/community.general/pull/10160)." - "dependent lookup plugin - removed compatibility code for ansible-core < 2.14 (https://github.com/ansible-collections/community.general/pull/10160)." - "flattened lookup plugin - removed compatibility code for ansible-core < 2.14 (https://github.com/ansible-collections/community.general/pull/10160)." - "redfish module utils - removed compatibility code for ansible-core < 2.14 (https://github.com/ansible-collections/community.general/pull/10160)." + - "maven_artifact - removed compatibility code for ansible-core < 2.12 (https://github.com/ansible-collections/community.general/pull/10192)." diff --git a/plugins/lookup/dependent.py b/plugins/lookup/dependent.py index 38087754b3..b243ee8e1f 100644 --- a/plugins/lookup/dependent.py +++ b/plugins/lookup/dependent.py @@ -124,7 +124,6 @@ from ansible.errors import AnsibleLookupError from ansible.module_utils.common._collections_compat import Mapping, Sequence from ansible.module_utils.six import string_types from ansible.plugins.lookup import LookupBase -from ansible.release import __version__ as ansible_version from ansible.template import Templar try: diff --git a/plugins/modules/maven_artifact.py b/plugins/modules/maven_artifact.py index a165c5a32a..fb294797f0 100644 --- a/plugins/modules/maven_artifact.py +++ b/plugins/modules/maven_artifact.py @@ -245,7 +245,6 @@ import tempfile import traceback import re -from ansible_collections.community.general.plugins.module_utils.version import LooseVersion from ansible.module_utils.ansible_release import __version__ as ansible_version from re import match @@ -648,10 +647,7 @@ def main(): mutually_exclusive=([('version', 'version_by_spec')]) ) - if LooseVersion(ansible_version) < LooseVersion("2.12") and module.params['unredirected_headers']: - module.fail_json(msg="Unredirected Headers parameter provided, but your ansible-core version does not support it. Minimum version is 2.12") - - if LooseVersion(ansible_version) >= LooseVersion("2.12") and module.params['unredirected_headers'] is None: + if module.params['unredirected_headers'] is None: # if the user did not supply unredirected params, we use the default, ONLY on ansible core 2.12 and above module.params['unredirected_headers'] = ['Authorization', 'Cookie'] diff --git a/tests/integration/targets/filter_lists_mergeby/tasks/main.yml b/tests/integration/targets/filter_lists_mergeby/tasks/main.yml index d0bda368cd..f599c2d93e 100644 --- a/tests/integration/targets/filter_lists_mergeby/tasks/main.yml +++ b/tests/integration/targets/filter_lists_mergeby/tasks/main.yml @@ -6,6 +6,5 @@ - name: Test list_merge default options import_tasks: lists_mergeby_default.yml -- name: Test list_merge non-default options in Ansible 2.10 and higher +- name: Test list_merge non-default options import_tasks: lists_mergeby_2-10.yml - when: ansible_version.full is version('2.10', '>=') diff --git a/tests/integration/targets/kernel_blacklist/tasks/main.yml b/tests/integration/targets/kernel_blacklist/tasks/main.yml index 61d766d48e..aecc9b68d5 100644 --- a/tests/integration/targets/kernel_blacklist/tasks/main.yml +++ b/tests/integration/targets/kernel_blacklist/tasks/main.yml @@ -65,7 +65,7 @@ - name: test deprecation assert: that: - - "'deprecations' not in bl_test_1 or (ansible_version.major == 2 and ansible_version.minor == 12)" + - "'deprecations' not in bl_test_1" - name: add new item to list community.general.kernel_blacklist: diff --git a/tests/integration/targets/test_a_module/runme.yml b/tests/integration/targets/test_a_module/runme.yml index 4b7a5ec2ce..6ab0a2f7fa 100644 --- a/tests/integration/targets/test_a_module/runme.yml +++ b/tests/integration/targets/test_a_module/runme.yml @@ -39,4 +39,3 @@ - "'onyx_pfc_interface' is not community.general.a_module" # Tombstoned module - "'community.general.docker_image_facts' is not community.general.a_module" - when: ansible_version.string is version('2.10.0', '>=') diff --git a/tests/utils/shippable/shippable.sh b/tests/utils/shippable/shippable.sh index 19337cb2f0..134ff6de4b 100755 --- a/tests/utils/shippable/shippable.sh +++ b/tests/utils/shippable/shippable.sh @@ -168,10 +168,8 @@ function cleanup ansible-test coverage xml --color -v --requirements --group-by command --group-by version ${stub:+"$stub"} cp -a tests/output/reports/coverage=*.xml "$SHIPPABLE_RESULT_DIR/codecoverage/" - if [ "${ansible_version}" != "2.9" ]; then - # analyze and capture code coverage aggregated by integration test target - ansible-test coverage analyze targets generate -v "$SHIPPABLE_RESULT_DIR/testresults/coverage-analyze-targets.json" - fi + # analyze and capture code coverage aggregated by integration test target + ansible-test coverage analyze targets generate -v "$SHIPPABLE_RESULT_DIR/testresults/coverage-analyze-targets.json" # upload coverage report to codecov.io only when using complete on-demand coverage if [ "${COVERAGE}" == "--coverage" ] && [ "${CHANGED}" == "" ]; then