From 9f6fce1bd4dcf235b8968aede57010bc5a7d2736 Mon Sep 17 00:00:00 2001 From: melanie witt Date: Wed, 28 Aug 2024 18:15:15 +0000 Subject: [PATCH] Fix AttributeError with 'SSHExecCommandFailed' Noticed in a CI failure today, the SSHExecCommandFailed exception is incorrectly accessed from the tempest.exceptions module instead of the tempest.lib.exceptions module where it is actually located: File "/opt/stack/tempest/tempest/api/compute/base.py", line 566, in verify_metadata_from_api if not test_utils.call_until_true(get_and_verify_metadata, File "/opt/stack/tempest/tempest/lib/common/utils/test_utils.py", line 117, in call_until_true if func(*args, **kwargs): File "/opt/stack/tempest/tempest/api/compute/base.py", line 550, in get_and_verify_metadata except exceptions.SSHExecCommandFailed: AttributeError: module 'tempest.exceptions' has no attribute 'SSHExecCommandFailed' This fixes the access. Change-Id: If8b0edf9df24b63e9c98218b1cdee1142efcd3ff --- tempest/api/compute/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tempest/api/compute/base.py b/tempest/api/compute/base.py index 1069e0f395..b974b522b9 100644 --- a/tempest/api/compute/base.py +++ b/tempest/api/compute/base.py @@ -547,7 +547,7 @@ class BaseV2ComputeTest(api_version_utils.BaseMicroversionTest, def get_and_verify_metadata(): try: ssh_client.exec_command('curl -V') - except exceptions.SSHExecCommandFailed: + except lib_exc.SSHExecCommandFailed: if not CONF.compute_feature_enabled.config_drive: raise self.skipException('curl not found in guest ' 'and config drive is '