Merge "Allow discover-tempest-config to run with no nova or glance endpoint"

This commit is contained in:
Zuul 2019-11-15 01:22:04 +00:00 committed by Gerrit Code Review
commit 64d8d08523
2 changed files with 29 additions and 20 deletions

View File

@ -526,19 +526,23 @@ def config_tempest(**kwargs):
if kwargs.get('create', False) and kwargs.get('test_accounts') is None:
users = Users(clients.projects, clients.roles, clients.users, conf)
users.create_tempest_users()
flavors = Flavors(clients.flavors, kwargs.get('create', False), conf,
kwargs.get('flavor_min_mem', C.DEFAULT_FLAVOR_RAM),
kwargs.get('flavor_min_disk', C.DEFAULT_FLAVOR_DISK),
no_rng=kwargs.get('no_rng', False))
flavors.create_tempest_flavors()
image = services.get_service('image')
image.set_image_preferences(kwargs.get('image_disk_format',
C.DEFAULT_IMAGE_FORMAT),
kwargs.get('non_admin', False),
no_rng=kwargs.get('no_rng', False),
convert=kwargs.get('convert_to_raw', False))
image.create_tempest_images(conf)
if services.is_service(**{"type": "compute"}):
flavors = Flavors(clients.flavors, kwargs.get('create', False), conf,
kwargs.get('flavor_min_mem', C.DEFAULT_FLAVOR_RAM),
kwargs.get('flavor_min_disk', C.DEFAULT_FLAVOR_DISK),
no_rng=kwargs.get('no_rng', False))
flavors.create_tempest_flavors()
if services.is_service(**{"type": "image"}):
image = services.get_service('image')
image.set_image_preferences(kwargs.get('image_disk_format',
C.DEFAULT_IMAGE_FORMAT),
kwargs.get('non_admin', False),
no_rng=kwargs.get('no_rng', False),
convert=kwargs.get('convert_to_raw',
False))
image.create_tempest_images(conf)
has_neutron = services.is_service(**{"type": "network"})
network = services.get_service("network")

View File

@ -65,11 +65,16 @@ class OrchestrationService(Service):
"heat_tempest_plugin cannot be set!")
def post_configuration(self, conf, is_service):
conf.set('heat_plugin', 'minimal_instance_type',
conf.get('compute', 'flavor_ref'))
conf.set('heat_plugin', 'instance_type',
conf.get('compute', 'flavor_ref_alt'))
conf.set('heat_plugin', 'minimal_image_ref',
conf.get('compute', 'image_ref'))
conf.set('heat_plugin', 'image_ref',
conf.get('compute', 'image_ref_alt'))
compute_options = conf.options('compute')
if 'flavor_ref' in compute_options:
conf.set('heat_plugin', 'minimal_instance_type',
conf.get('compute', 'flavor_ref'))
if 'flavor_ref_alt' in compute_options:
conf.set('heat_plugin', 'instance_type',
conf.get('compute', 'flavor_ref_alt'))
if 'image_ref' in compute_options:
conf.set('heat_plugin', 'minimal_image_ref',
conf.get('compute', 'image_ref'))
if 'image_ref_alt' in compute_options:
conf.set('heat_plugin', 'image_ref',
conf.get('compute', 'image_ref_alt'))