From 48ab2ddb5d3f7951a43f63f57e9a7346309693e1 Mon Sep 17 00:00:00 2001 From: "Chandan Kumar (raukadah)" Date: Fri, 17 Jan 2020 14:16:27 +0530 Subject: [PATCH] Update compute config only when compute section exists In nova less deployment, nova service is not there, so there will be no compute section in the tempest.conf byut when heat service got detected, it tries to update the compute section which does not exists leading to no section error. It fixes the same. Closes-Bug: #1860017 Change-Id: Id793975b2cc30038638275fe9f381ae21e6369bc Signed-off-by: Chandan Kumar (raukadah) --- config_tempest/services/orchestration.py | 27 ++++++++++++------------ 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/config_tempest/services/orchestration.py b/config_tempest/services/orchestration.py index db964867..f47b902f 100644 --- a/config_tempest/services/orchestration.py +++ b/config_tempest/services/orchestration.py @@ -65,16 +65,17 @@ class OrchestrationService(Service): "heat_tempest_plugin cannot be set!") def post_configuration(self, conf, is_service): - 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')) + if conf.has_section('compute'): + 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'))