From 1a9b3214fdf1eaccba5cc9ee210cbc5b5070fe4b Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 26 Apr 2022 11:51:01 +0200 Subject: [PATCH] [5.0.0] Remove Ansible 2.9 / ansible-base 2.10 compatibility code (#4548) * Remove Ansible 2.9 / ansible-base 2.10 compatibility code. * Remove path_join shim from BOTMETA. * Update comment. * Bump minimally required ansible-core version. --- .azure-pipelines/azure-pipelines.yml | 143 +----------------- .github/BOTMETA.yml | 2 - README.md | 4 +- .../4548-remove-2.9-2.10-compatibility.yml | 12 ++ meta/runtime.yml | 9 +- plugins/cache/memcached.py | 19 +-- plugins/cache/redis.py | 24 +-- plugins/callback/syslog_json.py | 2 +- plugins/filter/list.py | 18 +-- plugins/filter/path_join_shim.py | 28 ---- plugins/modules/files/archive.py | 9 +- .../packaging/language/maven_artifact.py | 8 +- plugins/modules/source_control/git_config.py | 8 +- plugins/modules/system/java_keystore.py | 8 +- plugins/test/a_module.py | 3 - .../ansible_galaxy_install/tasks/main.yml | 13 +- .../targets/filter_hashids/runme.sh | 1 - tests/integration/targets/filter_jc/runme.sh | 1 - .../targets/filter_json_query/runme.sh | 1 - .../lookup_collection_version/runme.sh | 1 - .../targets/test_a_module/runme.sh | 1 - tests/unit/plugins/cache/test_redis.py | 5 - 22 files changed, 44 insertions(+), 276 deletions(-) create mode 100644 changelogs/fragments/4548-remove-2.9-2.10-compatibility.yml delete mode 100644 plugins/filter/path_join_shim.py diff --git a/.azure-pipelines/azure-pipelines.yml b/.azure-pipelines/azure-pipelines.yml index 3a245d580e..aa62d82134 100644 --- a/.azure-pipelines/azure-pipelines.yml +++ b/.azure-pipelines/azure-pipelines.yml @@ -108,32 +108,6 @@ stages: - test: 2 - test: 3 - test: 4 - - stage: Sanity_2_10 - displayName: Sanity 2.10 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - nameFormat: Test {0} - testFormat: 2.10/sanity/{0} - targets: - - test: 1 - - test: 2 - - test: 3 - - test: 4 - - stage: Sanity_2_9 - displayName: Sanity 2.9 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - nameFormat: Test {0} - testFormat: 2.9/sanity/{0} - targets: - - test: 1 - - test: 2 - - test: 3 - - test: 4 ### Units - stage: Units_devel displayName: Units devel @@ -188,29 +162,8 @@ stages: - test: 2.6 - test: 2.7 - test: 3.5 - - test: 3.9 - - stage: Units_2_10 - displayName: Units 2.10 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - nameFormat: Python {0} - testFormat: 2.10/units/{0}/1 - targets: - - test: 2.7 - test: 3.6 - - stage: Units_2_9 - displayName: Units 2.9 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - nameFormat: Python {0} - testFormat: 2.9/units/{0}/1 - targets: - - test: 2.6 - - test: 3.5 + - test: 3.9 ## Remote - stage: Remote_devel @@ -285,38 +238,6 @@ stages: groups: - 1 - 2 - - stage: Remote_2_10 - displayName: Remote 2.10 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - testFormat: 2.10/{0} - targets: - - name: OS X 10.11 - test: osx/10.11 - - name: macOS 10.15 - test: macos/10.15 - groups: - - 1 - - 2 - - stage: Remote_2_9 - displayName: Remote 2.9 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - testFormat: 2.9/{0} - targets: - - name: RHEL 8.2 - test: rhel/8.2 - - name: RHEL 7.8 - test: rhel/7.8 - #- name: FreeBSD 12.0 - # test: freebsd/12.0 - groups: - - 1 - - 2 ### Docker - stage: Docker_devel @@ -389,6 +310,8 @@ stages: parameters: testFormat: 2.11/linux/{0} targets: + - name: Fedora 32 + test: fedora32 - name: Fedora 33 test: fedora33 - name: Alpine 3 @@ -396,34 +319,6 @@ stages: groups: - 2 - 3 - - stage: Docker_2_10 - displayName: Docker 2.10 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - testFormat: 2.10/linux/{0} - targets: - - name: Fedora 32 - test: fedora32 - - name: Ubuntu 16.04 - test: ubuntu1604 - groups: - - 2 - - 3 - - stage: Docker_2_9 - displayName: Docker 2.9 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - testFormat: 2.9/linux/{0} - targets: - - name: Fedora 31 - test: fedora31 - groups: - - 2 - - 3 ### Community Docker - stage: Docker_community_devel @@ -485,59 +380,31 @@ stages: parameters: nameFormat: Python {0} testFormat: 2.11/cloud/{0}/1 - targets: - - test: 3.6 - - stage: Cloud_2_10 - displayName: Cloud 2.10 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - nameFormat: Python {0} - testFormat: 2.10/cloud/{0}/1 - targets: - - test: 3.5 - - stage: Cloud_2_9 - displayName: Cloud 2.9 - dependsOn: [] - jobs: - - template: templates/matrix.yml - parameters: - nameFormat: Python {0} - testFormat: 2.9/cloud/{0}/1 targets: - test: 2.7 + - test: 3.5 + - stage: Summary condition: succeededOrFailed() dependsOn: - Sanity_devel - - Sanity_2_9 - - Sanity_2_10 - Sanity_2_11 - Sanity_2_12 - Sanity_2_13 - Units_devel - - Units_2_9 - - Units_2_10 - Units_2_11 - Units_2_12 - Units_2_13 - Remote_devel - - Remote_2_9 - - Remote_2_10 - Remote_2_11 - Remote_2_12 - Remote_2_13 - Docker_devel - - Docker_2_9 - - Docker_2_10 - Docker_2_11 - Docker_2_12 - Docker_2_13 - Docker_community_devel - Cloud_devel - - Cloud_2_9 - - Cloud_2_10 - Cloud_2_11 - Cloud_2_12 - Cloud_2_13 diff --git a/.github/BOTMETA.yml b/.github/BOTMETA.yml index 1153162ced..199ca9e4d1 100644 --- a/.github/BOTMETA.yml +++ b/.github/BOTMETA.yml @@ -135,8 +135,6 @@ files: $filters/json_query.py: {} $filters/list.py: maintainers: vbotka - $filters/path_join_shim.py: - maintainers: felixfontein $filters/random_mac.py: {} $filters/time.py: maintainers: resmo diff --git a/README.md b/README.md index c7a22e5aa7..e064b5f378 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,9 @@ If you encounter abusive behavior violating the [Ansible Code of Conduct](https: ## Tested with Ansible -Tested with the current Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13 releases and the current development version of ansible-core. Ansible versions before 2.9.10 are not supported. +Tested with the current ansible-core 2.11, ansible-core 2.12, ansible-core 2.13 releases and the current development version of ansible-core. Ansible-core versions before 2.11.0 are not supported. This includes all ansible-base 2.10 and Ansible 2.9 releases. -Parts of this collection will not work with ansible-core before 2.12 (this includes ansible-base and Ansible 2.9) on Python 3.12+. +Parts of this collection will not work with ansible-core 2.11 on Python 3.12+. ## External requirements diff --git a/changelogs/fragments/4548-remove-2.9-2.10-compatibility.yml b/changelogs/fragments/4548-remove-2.9-2.10-compatibility.yml new file mode 100644 index 0000000000..8f2273ee0c --- /dev/null +++ b/changelogs/fragments/4548-remove-2.9-2.10-compatibility.yml @@ -0,0 +1,12 @@ +major_changes: + - The community.general collection no longer supports Ansible 2.9 and ansible-base 2.10. While we take no active measures to prevent usage, we will remove a lot of compatibility code and other compatility measures that will effectively prevent using most content from this collection with Ansible 2.9, and some content of this collection with ansible-base 2.10. Both Ansible 2.9 and ansible-base 2.10 will very soon be End of Life and if you are still using them, you should consider upgrading to ansible-core 2.11 or later as soon as possible (https://github.com/ansible-collections/community.general/pull/4548). +breaking_changes: + - memcached cache plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). + - redis cache plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). + - lists_mergeby filter plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). + - path_join filter plugin shim - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). + - archive - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). + - maven_artifact - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). + - git_config - remove Ansible 2.9 and early ansible-base 2.10 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). + - java_keystore - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). + - a_module test plugin - remove Ansible 2.9 compatibility code (https://github.com/ansible-collections/community.general/pull/4548). diff --git a/meta/runtime.yml b/meta/runtime.yml index f593166692..cabfc5d80f 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -1,5 +1,5 @@ --- -requires_ansible: '>=2.9.10' +requires_ansible: '>=2.11.0' plugin_routing: connection: docker: @@ -624,6 +624,9 @@ plugin_routing: path_join: # The ansible.builtin.path_join filter has been added in ansible-base 2.10. # Since plugin routing is only available since ansible-base 2.10, this - # redirect will be used for ansible-base 2.10 or later, and the included - # path_join filter will be used for Ansible 2.9 or earlier. + # redirect will be used for ansible-base 2.10 or later. This was mostly + # relevant before community.general 5.0.0, when community.general also + # supported Ansible 2.9. Back then, the included path_join filter was used + # for Ansible 2.9 or earlier. Now we only will have the redirect until we + # eventually will deprecate and then remove it. redirect: ansible.builtin.path_join diff --git a/plugins/cache/memcached.py b/plugins/cache/memcached.py index dd6e0685c1..f2ea098d4d 100644 --- a/plugins/cache/memcached.py +++ b/plugins/cache/memcached.py @@ -176,20 +176,11 @@ class CacheModule(BaseCacheModule): def __init__(self, *args, **kwargs): connection = ['127.0.0.1:11211'] - try: - super(CacheModule, self).__init__(*args, **kwargs) - if self.get_option('_uri'): - connection = self.get_option('_uri') - self._timeout = self.get_option('_timeout') - self._prefix = self.get_option('_prefix') - except KeyError: - # TODO: remove once we no longer support Ansible 2.9 - if not ansible_base_version.startswith('2.9.'): - raise AnsibleError("Do not import CacheModules directly. Use ansible.plugins.loader.cache_loader instead.") - if C.CACHE_PLUGIN_CONNECTION: - connection = C.CACHE_PLUGIN_CONNECTION.split(',') - self._timeout = C.CACHE_PLUGIN_TIMEOUT - self._prefix = C.CACHE_PLUGIN_PREFIX + super(CacheModule, self).__init__(*args, **kwargs) + if self.get_option('_uri'): + connection = self.get_option('_uri') + self._timeout = self.get_option('_timeout') + self._prefix = self.get_option('_prefix') if not HAS_MEMCACHE: raise AnsibleError("python-memcached is required for the memcached fact cache") diff --git a/plugins/cache/redis.py b/plugins/cache/redis.py index 3c73d8b5be..6c2edb5f61 100644 --- a/plugins/cache/redis.py +++ b/plugins/cache/redis.py @@ -99,23 +99,13 @@ class CacheModule(BaseCacheModule): def __init__(self, *args, **kwargs): uri = '' - try: - super(CacheModule, self).__init__(*args, **kwargs) - if self.get_option('_uri'): - uri = self.get_option('_uri') - self._timeout = float(self.get_option('_timeout')) - self._prefix = self.get_option('_prefix') - self._keys_set = self.get_option('_keyset_name') - self._sentinel_service_name = self.get_option('_sentinel_service_name') - except KeyError: - # TODO: remove once we no longer support Ansible 2.9 - if not ansible_base_version.startswith('2.9.'): - raise AnsibleError("Do not import CacheModules directly. Use ansible.plugins.loader.cache_loader instead.") - if C.CACHE_PLUGIN_CONNECTION: - uri = C.CACHE_PLUGIN_CONNECTION - self._timeout = float(C.CACHE_PLUGIN_TIMEOUT) - self._prefix = C.CACHE_PLUGIN_PREFIX - self._keys_set = 'ansible_cache_keys' + super(CacheModule, self).__init__(*args, **kwargs) + if self.get_option('_uri'): + uri = self.get_option('_uri') + self._timeout = float(self.get_option('_timeout')) + self._prefix = self.get_option('_prefix') + self._keys_set = self.get_option('_keyset_name') + self._sentinel_service_name = self.get_option('_sentinel_service_name') if not HAS_REDIS: raise AnsibleError("The 'redis' python module (version 2.4.5 or newer) is required for the redis fact cache, 'pip install redis'") diff --git a/plugins/callback/syslog_json.py b/plugins/callback/syslog_json.py index 0d71545495..e6fc1ee261 100644 --- a/plugins/callback/syslog_json.py +++ b/plugins/callback/syslog_json.py @@ -15,7 +15,7 @@ DOCUMENTATION = ''' short_description: sends JSON events to syslog description: - This plugin logs ansible-playbook and ansible runs to a syslog server in JSON format - - Before 2.9 only environment variables were available for configuration + - Before Ansible 2.9 only environment variables were available for configuration options: server: description: syslog server that will receive the event diff --git a/plugins/filter/list.py b/plugins/filter/list.py index 005e4b7c70..4b21fb95fa 100644 --- a/plugins/filter/list.py +++ b/plugins/filter/list.py @@ -16,22 +16,6 @@ from collections import defaultdict from operator import itemgetter -def merge_hash_wrapper(x, y, recursive=False, list_merge='replace'): - ''' Wrapper of the function merge_hash from ansible.utils.vars. Only 2 paramaters are allowed - for Ansible 2.9 and lower.''' - - if LooseVersion(ansible_version) < LooseVersion('2.10'): - if list_merge != 'replace' or recursive: - msg = ("Non default options of list_merge(default=replace) or recursive(default=False) " - "are not allowed in Ansible version 2.9 or lower. Ansible version is %s, " - "recursive=%s, and list_merge=%s.") - raise AnsibleFilterError(msg % (ansible_version, recursive, list_merge)) - else: - return merge_hash(x, y) - else: - return merge_hash(x, y, recursive, list_merge) - - def list_mergeby(x, y, index, recursive=False, list_merge='replace'): ''' Merge 2 lists by attribute 'index'. The function merge_hash from ansible.utils.vars is used. This function is used by the function lists_mergeby. @@ -44,7 +28,7 @@ def list_mergeby(x, y, index, recursive=False, list_merge='replace'): msg = "Elements of list arguments for lists_mergeby must be dictionaries. %s is %s" raise AnsibleFilterError(msg % (elem, type(elem))) if index in elem.keys(): - d[elem[index]].update(merge_hash_wrapper(d[elem[index]], elem, recursive, list_merge)) + d[elem[index]].update(merge_hash(d[elem[index]], elem, recursive, list_merge)) return sorted(d.values(), key=itemgetter(index)) diff --git a/plugins/filter/path_join_shim.py b/plugins/filter/path_join_shim.py deleted file mode 100644 index 9734298a15..0000000000 --- a/plugins/filter/path_join_shim.py +++ /dev/null @@ -1,28 +0,0 @@ -# -*- coding: utf-8 -*- - -# Copyright: (c) 2020-2021, Felix Fontein -# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - - -import os.path - - -def path_join(list): - '''Join list of paths. - - This is a minimal shim for ansible.builtin.path_join included in ansible-base 2.10. - This should only be called by Ansible 2.9 or earlier. See meta/runtime.yml for details. - ''' - return os.path.join(*list) - - -class FilterModule(object): - '''Ansible jinja2 filters''' - - def filters(self): - return { - 'path_join': path_join, - } diff --git a/plugins/modules/files/archive.py b/plugins/modules/files/archive.py index 91dc6e5112..7b13eb6c4d 100644 --- a/plugins/modules/files/archive.py +++ b/plugins/modules/files/archive.py @@ -440,14 +440,7 @@ class Archive(object): ) def update_permissions(self): - try: - file_args = self.module.load_file_common_arguments(self.module.params, path=self.destination) - except TypeError: - # The path argument is only supported in Ansible-base 2.10+. Fall back to - # pre-2.10 behavior for older Ansible versions. - self.module.params['path'] = self.destination - file_args = self.module.load_file_common_arguments(self.module.params) - + file_args = self.module.load_file_common_arguments(self.module.params, path=self.destination) self.changed = self.module.set_fs_attributes_if_different(file_args, self.changed) @property diff --git a/plugins/modules/packaging/language/maven_artifact.py b/plugins/modules/packaging/language/maven_artifact.py index c184830580..eee3e2f67d 100644 --- a/plugins/modules/packaging/language/maven_artifact.py +++ b/plugins/modules/packaging/language/maven_artifact.py @@ -712,13 +712,7 @@ def main(): except ValueError as e: module.fail_json(msg=e.args[0]) - try: - file_args = module.load_file_common_arguments(module.params, path=dest) - except TypeError: - # The path argument is only supported in Ansible-base 2.10+. Fall back to - # pre-2.10 behavior for older Ansible versions. - module.params['path'] = dest - file_args = module.load_file_common_arguments(module.params) + file_args = module.load_file_common_arguments(module.params, path=dest) changed = module.set_fs_attributes_if_different(file_args, changed) if changed: module.exit_json(state=state, dest=dest, group_id=group_id, artifact_id=artifact_id, version=version, classifier=classifier, diff --git a/plugins/modules/source_control/git_config.py b/plugins/modules/source_control/git_config.py index ab71370115..8651458610 100644 --- a/plugins/modules/source_control/git_config.py +++ b/plugins/modules/source_control/git_config.py @@ -263,13 +263,7 @@ def main(): cmd = args else: cmd = args + [new_value] - try: # try using extra parameter from ansible-base 2.10.4 onwards - (rc, out, err) = module.run_command(cmd, cwd=dir, ignore_invalid_cwd=False, expand_user_and_vars=False) - except TypeError: - # @TODO remove try/except when community.general drop support for 2.10.x - if not os.path.isdir(dir): - module.fail_json(msg="Cannot find directory '{0}'".format(dir)) - (rc, out, err) = module.run_command(cmd, cwd=dir, expand_user_and_vars=False) + (rc, out, err) = module.run_command(cmd, cwd=dir, ignore_invalid_cwd=False, expand_user_and_vars=False) if err: module.fail_json(rc=rc, msg=err, cmd=cmd) diff --git a/plugins/modules/system/java_keystore.py b/plugins/modules/system/java_keystore.py index 5cc2e9258a..772d3a69b1 100644 --- a/plugins/modules/system/java_keystore.py +++ b/plugins/modules/system/java_keystore.py @@ -261,13 +261,7 @@ class JavaKeystore: self.private_key_path = module.params['private_key_path'] def update_permissions(self): - try: - file_args = self.module.load_file_common_arguments(self.module.params, path=self.keystore_path) - except TypeError: - # The path argument is only supported in Ansible-base 2.10+. Fall back to - # pre-2.10 behavior for older Ansible versions. - self.module.params['path'] = self.keystore_path - file_args = self.module.load_file_common_arguments(self.module.params) + file_args = self.module.load_file_common_arguments(self.module.params, path=self.keystore_path) return self.module.set_fs_attributes_if_different(file_args, False) def read_certificate_fingerprint(self, cert_format='PEM'): diff --git a/plugins/test/a_module.py b/plugins/test/a_module.py index 36c13ffabd..565d1a14a2 100644 --- a/plugins/test/a_module.py +++ b/plugins/test/a_module.py @@ -22,9 +22,6 @@ def a_module(term): try: for loader in (action_loader, module_loader): data = loader.find_plugin(term) - # Ansible 2.9 returns a tuple - if isinstance(data, tuple): - data = data[0] if data is not None: return True return False diff --git a/tests/integration/targets/ansible_galaxy_install/tasks/main.yml b/tests/integration/targets/ansible_galaxy_install/tasks/main.yml index 276dab3a30..db0ad4d2a5 100644 --- a/tests/integration/targets/ansible_galaxy_install/tasks/main.yml +++ b/tests/integration/targets/ansible_galaxy_install/tasks/main.yml @@ -64,23 +64,12 @@ register: install_rq0 ignore_errors: true -- name: Assert requirements file was installed (Ansible >2.9) +- name: Assert requirements file was installed assert: that: - install_rq0 is changed - '"geerlingguy.java" in install_rq0.new_roles' - '"geerlingguy.php_roles" in install_rq0.new_collections' - when: - - (ansible_version.major != 2 or ansible_version.minor != 9) - -- name: Assert requirements file was installed (Ansible 2.9) - assert: - that: - - install_rq0 is failed - - install_rq0 is not changed - when: - - ansible_version.major == 2 - - ansible_version.minor == 9 - name: Install from requirements file (again) community.general.ansible_galaxy_install: diff --git a/tests/integration/targets/filter_hashids/runme.sh b/tests/integration/targets/filter_hashids/runme.sh index 313ea4bb83..38b40e8ff3 100755 --- a/tests/integration/targets/filter_hashids/runme.sh +++ b/tests/integration/targets/filter_hashids/runme.sh @@ -2,7 +2,6 @@ set -eux -export ANSIBLE_TEST_PREFER_VENV=1 # see https://github.com/ansible/ansible/pull/73000#issuecomment-757012395; can be removed once Ansible 2.9 and ansible-base 2.10 support has been dropped source virtualenv.sh # Requirements have to be installed prior to running ansible-playbook diff --git a/tests/integration/targets/filter_jc/runme.sh b/tests/integration/targets/filter_jc/runme.sh index d233385dad..17c5beca9d 100755 --- a/tests/integration/targets/filter_jc/runme.sh +++ b/tests/integration/targets/filter_jc/runme.sh @@ -2,7 +2,6 @@ set -eux -export ANSIBLE_TEST_PREFER_VENV=1 # see https://github.com/ansible/ansible/pull/73000#issuecomment-757012395; can be removed once Ansible 2.9 and ansible-base 2.10 support has been dropped source virtualenv.sh # Requirements have to be installed prior to running ansible-playbook diff --git a/tests/integration/targets/filter_json_query/runme.sh b/tests/integration/targets/filter_json_query/runme.sh index d32116cc25..a0db5e5400 100755 --- a/tests/integration/targets/filter_json_query/runme.sh +++ b/tests/integration/targets/filter_json_query/runme.sh @@ -2,7 +2,6 @@ set -eux -export ANSIBLE_TEST_PREFER_VENV=1 # see https://github.com/ansible/ansible/pull/73000#issuecomment-757012395; can be removed once Ansible 2.9 and ansible-base 2.10 support has been dropped source virtualenv.sh # Requirements have to be installed prior to running ansible-playbook diff --git a/tests/integration/targets/lookup_collection_version/runme.sh b/tests/integration/targets/lookup_collection_version/runme.sh index 8ce47c86d0..a0a78be131 100755 --- a/tests/integration/targets/lookup_collection_version/runme.sh +++ b/tests/integration/targets/lookup_collection_version/runme.sh @@ -2,7 +2,6 @@ set -eux -export ANSIBLE_TEST_PREFER_VENV=1 # see https://github.com/ansible/ansible/pull/73000#issuecomment-757012395; can be removed once Ansible 2.9 and ansible-base 2.10 support has been dropped source virtualenv.sh # The collection loader ignores paths which have more than one ansible_collections in it. diff --git a/tests/integration/targets/test_a_module/runme.sh b/tests/integration/targets/test_a_module/runme.sh index 8ce47c86d0..a0a78be131 100755 --- a/tests/integration/targets/test_a_module/runme.sh +++ b/tests/integration/targets/test_a_module/runme.sh @@ -2,7 +2,6 @@ set -eux -export ANSIBLE_TEST_PREFER_VENV=1 # see https://github.com/ansible/ansible/pull/73000#issuecomment-757012395; can be removed once Ansible 2.9 and ansible-base 2.10 support has been dropped source virtualenv.sh # The collection loader ignores paths which have more than one ansible_collections in it. diff --git a/tests/unit/plugins/cache/test_redis.py b/tests/unit/plugins/cache/test_redis.py index ee7e1f7913..9fdc3584ec 100644 --- a/tests/unit/plugins/cache/test_redis.py +++ b/tests/unit/plugins/cache/test_redis.py @@ -25,21 +25,16 @@ pytest.importorskip('redis') from ansible import constants as C from ansible.plugins.loader import cache_loader -from ansible.release import __version__ as ansible_version from ansible_collections.community.general.plugins.cache.redis import CacheModule as RedisCache def test_redis_cachemodule(): # The _uri option is required for the redis plugin connection = '127.0.0.1:6379:1' - if ansible_version.startswith('2.9.'): - C.CACHE_PLUGIN_CONNECTION = connection assert isinstance(cache_loader.get('community.general.redis', **{'_uri': connection}), RedisCache) def test_redis_cachemodule(): # The _uri option is required for the redis plugin connection = '[::1]:6379:1' - if ansible_version.startswith('2.9.'): - C.CACHE_PLUGIN_CONNECTION = connection assert isinstance(cache_loader.get('community.general.redis', **{'_uri': connection}), RedisCache)