From 514b0ca612a7c804dacc94b211fc11be002c7984 Mon Sep 17 00:00:00 2001 From: Damian Dabrowski Date: Tue, 21 Jun 2022 09:29:46 +0200 Subject: [PATCH] Fix the behavior of defining fixed_network_name Currently we define fixed_network_name only when tempest_create_isolated_networks == False. It makes things complicated because tempest_create_isolated_networks is applicable only when dynamic credentials are used. fixed_network_name should be also defined when dynamic credentials are not used. Basically the only scenario when fixed_network_name should not be defined is using dynamic credentials together with tempest_create_isolated_networks. fixed_network_name should be defined in all other cases. Change-Id: I547d70995de5afbdc84c9f4e86b2599ad4cb100b --- defaults/main.yml | 2 +- templates/tempest.conf.j2 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 6fe886c3..0ef5f825 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -49,7 +49,7 @@ tempest_test_accounts: "" tempest_test_accounts_file_path: "{{ tempest_workspace }}/etc/tempest_accounts.yaml" # tempest_create_isolated_networks has an effect only when use_dynamic_credentials is enabled tempest_create_isolated_networks: true -# tempest_fixed_network_name has an effect only when tempest_create_isolated_networks is disabled +# tempest_fixed_network_name does not have an effect when dynamic credentials are used together with tempest_create_isolated_networks tempest_fixed_network_name: public # Tempest Resources diff --git a/templates/tempest.conf.j2 b/templates/tempest.conf.j2 index 31b4781c..6dcdea4a 100644 --- a/templates/tempest.conf.j2 +++ b/templates/tempest.conf.j2 @@ -74,7 +74,8 @@ image_ref = {{ tempest_glance_image_id_1 }} image_ref_alt = {{ tempest_glance_image_id_2 }} flavor_ref = {{ tempest_nova_flavor_id_1 }} flavor_ref_alt = {{ tempest_nova_flavor_id_2 }} -{% if not tempest_create_isolated_networks | bool %} +# do not define fixed_network_name when dynamic credentials are used together with tempest_create_isolated_networks +{% if not ((tempest_test_accounts | length == 0) and (tempest_create_isolated_networks | bool)) %} fixed_network_name = {{ tempest_fixed_network_name }} {% endif %} endpoint_type = {{ tempest_endpoint_type }}