From 65ab20fc37eb10c467785f94c4e54deddede4836 Mon Sep 17 00:00:00 2001 From: cheyenneb Date: Sat, 14 Oct 2023 16:43:30 -0400 Subject: [PATCH] Support files removed for CONF.scenario.img_dir option CONF.scenario.img_dir file has been removed along with any other support files. Exception has been raised when a user passes an img file that does not exist in the CONF.scenario.img_file. Exceptions import has been added for lib_exc. Closes-Bug: #2032948 Change-Id: I2b57dd4928ab3f6858909fc90b7865aac2d93da2 --- .../tests/scenario/barbican_manager.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/barbican_tempest_plugin/tests/scenario/barbican_manager.py b/barbican_tempest_plugin/tests/scenario/barbican_manager.py index b6f24a9..7460a38 100644 --- a/barbican_tempest_plugin/tests/scenario/barbican_manager.py +++ b/barbican_tempest_plugin/tests/scenario/barbican_manager.py @@ -30,6 +30,7 @@ from cryptography.x509.oid import NameOID from oslo_log import log as logging from tempest.api.compute import api_microversion_fixture from tempest import config +from tempest.lib import exceptions as lib_exc from barbican_tempest_plugin.tests.scenario import manager as mgr @@ -55,18 +56,13 @@ class BarbicanScenarioTest(mgr.ScenarioTest): self.request_microversion)) self.img_file = CONF.scenario.img_file if not os.path.exists(self.img_file): - # TODO(kopecmartin): replace LOG.warning for rasing - # InvalidConfiguration exception after tempest 25.0.0 is - # released - there will be one release which accepts both - # behaviors in order to avoid many failures across CIs and etc. - LOG.warning( + lib_exc.InvalidConfiguration( 'Starting Tempest 25.0.0 release, CONF.scenario.img_file need ' 'a full path for the image. CONF.scenario.img_dir was ' 'deprecated and will be removed in the next release. Till ' - 'Tempest 25.0.0, old behavior is maintained and keep working ' + 'Tempest 25.0.0, old behavior was maintained and kept working ' 'but starting Tempest 26.0.0, you need to specify the full ' 'path in CONF.scenario.img_file config option.') - self.img_file = os.path.join(CONF.scenario.img_dir, self.img_file) self.private_key = rsa.generate_private_key(public_exponent=65537, key_size=3072,