[stable-2.10] ansible-test - Fix cloud plugin traceback.

(cherry picked from commit 7a8c6d7418)

Co-authored-by: Matt Clay <matt@mystile.com>
pull/77469/head
Matt Clay 3 years ago
parent d708028e07
commit 2a15808cfc

@ -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)

@ -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))

Loading…
Cancel
Save