summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Clay <matt@mystile.com>2022-03-11 09:42:51 -0800
committerMatt Clay <matt@mystile.com>2022-03-11 10:29:36 -0800
commit7a8c6d74188b56228db77fed727cf1fdf3cc141d (patch)
treef46ae57821533405816c80b7ed986a9a3ecacd3c
parent995ca083db05047cb484a71f3381fd3e11954f85 (diff)
downloadansible-7a8c6d74188b56228db77fed727cf1fdf3cc141d.tar.gz
ansible-test - Fix cloud plugin traceback.
-rw-r--r--changelogs/fragments/ansible-test-remote-cloud-skip-traceback.yml2
-rw-r--r--test/lib/ansible_test/_internal/cloud/__init__.py3
2 files changed, 5 insertions, 0 deletions
diff --git a/changelogs/fragments/ansible-test-remote-cloud-skip-traceback.yml b/changelogs/fragments/ansible-test-remote-cloud-skip-traceback.yml
new file mode 100644
index 0000000000..6fcb9b9776
--- /dev/null
+++ b/changelogs/fragments/ansible-test-remote-cloud-skip-traceback.yml
@@ -0,0 +1,2 @@
+bugfixes:
+ - ansible-test - Fix an integration test traceback that occurs when some tests use cloud plugins, but all tests for at least one cloud plugin are skipped. (https://github.com/ansible/ansible/issues/75711)
diff --git a/test/lib/ansible_test/_internal/cloud/__init__.py b/test/lib/ansible_test/_internal/cloud/__init__.py
index 08a1183e06..54fc652f44 100644
--- a/test/lib/ansible_test/_internal/cloud/__init__.py
+++ b/test/lib/ansible_test/_internal/cloud/__init__.py
@@ -197,6 +197,9 @@ class CloudBase(ABC):
def config_callback(files): # type: (t.List[t.Tuple[str, str]]) -> None
"""Add the config file to the payload file list."""
+ if self.platform not in self.args.metadata.cloud_config:
+ return # callback registered, but plugin not initialized due to relevant tests being skipped
+
if self._get_cloud_config(self._CONFIG_PATH, ''):
pair = (self.config_path, os.path.relpath(self.config_path, data_context().content.root))