Only set flavor and image vars from conf is conf has them

Otherwise the tests bail out early on a Python runtime issue with
trying to set the environ to None.
This commit is contained in:
Chris Dent 2018-01-10 16:16:13 +00:00
parent 1fe8486eec
commit 262be4c225
1 changed files with 6 additions and 3 deletions

View File

@ -58,9 +58,12 @@ class GenericGabbiTest(tempest.test.BaseTestCase):
name = '%s_BASE' % service_type.upper()
os.environ[name] = '://'.join(urlparse.urlparse(url)[0:2])
os.environ['SERVICE_TOKEN'] = token
os.environ['IMAGE_REF'] = CONF.compute.image_ref
os.environ['FLAVOR_REF'] = CONF.compute.flavor_ref
os.environ['FLAVOR_REF_ALT'] = CONF.compute.flavor_ref_alt
if CONF.compute.image_ref:
os.environ['IMAGE_REF'] = CONF.compute.image_ref
if CONF.compute.flavor_ref:
os.environ['FLAVOR_REF'] = CONF.compute.flavor_ref
if CONF.compute.flavor_ref_alt:
os.environ['FLAVOR_REF_ALT'] = CONF.compute.flavor_ref_alt
@classmethod
def clear_credentials(cls):