From 8e14240d232366b8b1dd7de59800595211698fc1 Mon Sep 17 00:00:00 2001 From: Eric Berglund Date: Tue, 29 Nov 2016 17:33:28 -0600 Subject: [PATCH] Confirm network is created before setting public_network_id The current code assumes that there exists a public openstack network and uses that assumption to set the public_network_id variable in tempest lib. If NEUTRON_CREATE_INITIAL_NETWORKS is set to false this step will fail as there is no public network to be found. This change adds a check for NEUTRON_CREATE_INITIAL_NETWORKS before attempting to set this variable. Change-Id: I62e74d350d6533fa842d64c15b01b1a3d42c71c2 Closes-Bug: #1645900 --- lib/tempest | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/tempest b/lib/tempest index 6dc83b558e..a1b84b6bfc 100644 --- a/lib/tempest +++ b/lib/tempest @@ -241,7 +241,9 @@ function configure_tempest { # the public network (for floating ip access) is only available # if the extension is enabled. - if is_networking_extension_supported 'external-net'; then + # If NEUTRON_CREATE_INITIAL_NETWORKS is not true, there is no network created + # and the public_network_id should not be set. + if [[ "$NEUTRON_CREATE_INITIAL_NETWORKS" == "True" ]] && is_networking_extension_supported 'external-net'; then public_network_id=$(openstack network show -f value -c id $PUBLIC_NETWORK_NAME) fi