From 490a7ea40bdc6de4b1e0f354e481d405223dce3b Mon Sep 17 00:00:00 2001 From: Martin Kopec Date: Mon, 21 Feb 2022 15:43:38 +0000 Subject: [PATCH] Fix no floating_network_name option If there is no public network set, python-tempestconf doesn't set network.floating_network_name option. In order to avoid the following error when heat_plugin options are being set: No option 'floating_network_name' in section: 'network' the commit adds a try except block to catch this situation and log it for the user. Change-Id: Ib1f04584b620fc662fd415c4430a03ea92c35b76 --- config_tempest/services/orchestration.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/config_tempest/services/orchestration.py b/config_tempest/services/orchestration.py index 2dd49fcb..27602953 100644 --- a/config_tempest/services/orchestration.py +++ b/config_tempest/services/orchestration.py @@ -117,6 +117,11 @@ class OrchestrationService(Service): conf.set('heat_plugin', 'image_ref', conf.get('compute', 'image_ref_alt')) if conf.has_section('network'): - network = conf.get('network', 'floating_network_name') - conf.set('heat_plugin', 'network_for_ssh', network) - conf.set('heat_plugin', 'floating_network_name', network) + try: + network = conf.get('network', 'floating_network_name') + conf.set('heat_plugin', 'network_for_ssh', network) + conf.set('heat_plugin', 'floating_network_name', network) + except configparser.NoOptionError: + LOG.info("heat_plugin.network_for_ssh and heat_plugin." + "floating_network_name are not set because there " + "is no floating network")