Fix http_image uploading to glance

image.http_image was during the refactoring mistaken for an image
which is uploaded to glance and that caused the issues described
in the linked story.
image.http_image is a tempest option which defines http accessible
image. It can be also in a compressed format, so it can't be
uploaded to glance before it's unpacked first.
The patch introduces a new python-tempestconf option in tempest.conf
defining an image which will be uploaded to glance.

Story: 2002931
Task: 22918
Change-Id: Idc03155b345d341903c2941f41ec4677a503b531
This commit is contained in:
Martin Kopec
2018-07-10 11:52:40 +00:00
parent 3a40d5fe98
commit dcc4e9a5dd
3 changed files with 19 additions and 5 deletions

View File

@@ -139,7 +139,7 @@ def read_deployer_input(deployer_input_file, conf):
conf.set(section, key, value, priority=True)
def set_options(conf, deployer_input, non_admin, overrides=[],
def set_options(conf, deployer_input, non_admin, image_path, overrides=[],
test_accounts=None, cloud_creds=None,
no_default_deployer=False):
"""Set options in conf provided by different source.
@@ -155,6 +155,8 @@ def set_options(conf, deployer_input, non_admin, overrides=[],
:param deployer_input: Path to the deployer inut file
:type deployer_input: string
:type non_admin: boolean
:param image_path: An image to be uploaded to glance
:type image_path: string
:param overrides: list of tuples: [(section, key, value)]
:type overrides: list
:param test_accounts: Path to the accounts.yaml file
@@ -163,6 +165,9 @@ def set_options(conf, deployer_input, non_admin, overrides=[],
:type cloud_creds: dict
"""
load_basic_defaults(conf)
# image.image_path is a python-tempestconf option which defines which
# image will be uploaded to glance
conf.set('image', 'image_path', image_path)
if deployer_input and os.path.isfile(deployer_input):
LOG.info("Reading deployer input from file {}".format(
@@ -387,6 +392,7 @@ def config_tempest(**kwargs):
conf = TempestConf(write_credentials=write_credentials)
set_options(conf, kwargs.get('deployer_input'),
kwargs.get('non_admin', False),
kwargs.get('image_path', C.DEFAULT_IMAGE),
kwargs.get('overrides', []), kwargs.get('test_accounts'),
kwargs.get('cloud_creds'))
@@ -401,7 +407,6 @@ def config_tempest(**kwargs):
flavors.create_tempest_flavors()
image = services.get_service('image')
conf.set('image', 'http_image', kwargs.get('image_path', C.DEFAULT_IMAGE))
image.set_image_preferences(kwargs.get('image_disk_format',
C.DEFAULT_IMAGE_FORMAT),
kwargs.get('non_admin', False))