From 4f1e5823910c7928692618981c69058969f90c27 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 30 Sep 2022 09:01:20 +0200 Subject: [PATCH 1/2] Revert "Work around for #1083 (#1086)" This reverts commit e0aeafdc00558665e9ec4c36e6c0f15835881b5f. --- changelogs/fragments/1083-__spec__-is-None.yml | 2 -- plugins/module_utils/cloud.py | 14 ++++---------- 2 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 changelogs/fragments/1083-__spec__-is-None.yml diff --git a/changelogs/fragments/1083-__spec__-is-None.yml b/changelogs/fragments/1083-__spec__-is-None.yml deleted file mode 100644 index 332a38c82fa..00000000000 --- a/changelogs/fragments/1083-__spec__-is-None.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: -- 'module_utils/cloud - Fix ``ValueError: ansible_collections.amazon.aws.plugins.module_utils.core.__spec__ is None`` error on Ansible 2.9 (https://github.com/ansible-collections/amazon.aws/issues/1083).' diff --git a/plugins/module_utils/cloud.py b/plugins/module_utils/cloud.py index baf190e1b4f..e690c0a8699 100644 --- a/plugins/module_utils/cloud.py +++ b/plugins/module_utils/cloud.py @@ -32,12 +32,7 @@ import time import functools import random - -try: - import ansible.module_utils.common.warnings as ansible_warnings - ANCIENT_ANSIBLE = False -except ImportError: - ANCIENT_ANSIBLE = True +import ansible.module_utils.common.warnings as ansible_warnings class BackoffIterator: @@ -205,10 +200,9 @@ def backoff(cls, tries=10, delay=3, backoff=1.1, catch_extra_error_codes=None): """ # This won't emit a warning (we don't have the context available to us), but will trigger # sanity failures as we prepare for 6.0.0 - if not ANCIENT_ANSIBLE: - ansible_warnings.deprecate( - 'CloudRetry.backoff has been deprecated, please use CloudRetry.exponential_backoff instead', - version='6.0.0', collection_name='amazon.aws') + ansible_warnings.deprecate( + 'CloudRetry.backoff has been deprecated, please use CloudRetry.exponential_backoff instead', + version='6.0.0', collection_name='amazon.aws') return cls.exponential_backoff( retries=tries, From 1ee05e73479e73ba0d913f21ddc5d74ee06c6078 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 30 Sep 2022 09:40:57 +0200 Subject: [PATCH 2/2] changelog --- changelogs/fragments/1094-revert.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 changelogs/fragments/1094-revert.yml diff --git a/changelogs/fragments/1094-revert.yml b/changelogs/fragments/1094-revert.yml new file mode 100644 index 00000000000..77b9671c168 --- /dev/null +++ b/changelogs/fragments/1094-revert.yml @@ -0,0 +1,2 @@ +trivial: +- revert Work around for #1083 (https://github.com/ansible-collections/amazon.aws/pull/1094).