Browse code

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

Eric Berglund authored on 2016/11/30 08:33:28
Showing 1 changed files
... ...
@@ -241,7 +241,9 @@ function configure_tempest {
241 241
 
242 242
     # the public network (for floating ip access) is only available
243 243
     # if the extension is enabled.
244
-    if is_networking_extension_supported 'external-net'; then
244
+    # If NEUTRON_CREATE_INITIAL_NETWORKS is not true, there is no network created
245
+    # and the public_network_id should not be set.
246
+    if [[ "$NEUTRON_CREATE_INITIAL_NETWORKS" == "True" ]] && is_networking_extension_supported 'external-net'; then
245 247
         public_network_id=$(openstack network show -f value -c id $PUBLIC_NETWORK_NAME)
246 248
     fi
247 249