Merge "Remove deprecated scenario img_dir option"

This commit is contained in:
Zuul 2021-03-22 18:32:16 +00:00 committed by Gerrit Code Review
commit 5f54db93eb
3 changed files with 10 additions and 13 deletions

View File

@ -0,0 +1,8 @@
---
upgrade:
- |
img_dir scenario option has been deprecated and it's being removed.
Starting Tempest 25.0.0 release, CONF.scenario.img_file needs a full path
for the image. Until this release, old behavior was maintained and kept
working however a user needs to specify the full path in
CONF.scenario.img_file config option from now on.

View File

@ -1148,12 +1148,6 @@ ObjectStoreFeaturesGroup = [
scenario_group = cfg.OptGroup(name='scenario', title='Scenario Test Options')
ScenarioGroup = [
cfg.StrOpt('img_dir',
default='/opt/stack/new/devstack/files/images/'
'cirros-0.3.1-x86_64-uec',
help='Directory containing image files, this has been '
'deprecated - img_file option contains a full path now.',
deprecated_for_removal=True),
cfg.StrOpt('img_file', deprecated_name='qcow2_img_file',
default='/opt/stack/new/devstack/files/images'
'/cirros-0.3.1-x86_64-disk.img',

View File

@ -641,18 +641,13 @@ class ScenarioTest(tempest.test.BaseTestCase):
def image_create(self, name='scenario-img', **kwargs):
img_path = CONF.scenario.img_file
if not os.path.exists(img_path):
# 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.')
img_path = os.path.join(CONF.scenario.img_dir, img_path)
img_container_format = CONF.scenario.img_container_format
img_disk_format = CONF.scenario.img_disk_format
img_properties = CONF.scenario.img_properties