diff options
-rw-r--r-- | changelogs/fragments/ansible-test-remote-cloud-skip-traceback.yml | 2 | ||||
-rw-r--r-- | test/lib/ansible_test/_internal/cloud/__init__.py | 3 |
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 04f592c4e7..4a31ebcf31 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)) |