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
This commit is contained in:
melanie witt 2024-08-28 18:15:15 +00:00
parent 32da46943e
commit 9f6fce1bd4

View File

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