Fix multiple errors in network configuration function

- Remove extra whitespace
- Get first available network only in case if ext_net_is
was not set previously

Change-Id: I998a04727e95c283b8a848d09c7df125eb53a7c0
Related-Bug: #1618999
This commit is contained in:
Victor Ryzhenkin 2016-09-13 14:23:06 +04:00
parent 4c93ad397e
commit 9a2a63c0a7
1 changed files with 3 additions and 3 deletions

View File

@ -121,10 +121,10 @@ function configure_murano_networking {
--os-region-name="$REGION_NAME" network list \
--external | grep " $ext_net " | get_field 1)
# Try to select first available external network
if [[ -n "$ext_net_id" ]]; then
# Try to select first available external network if ext_net_id is null
if [[ ! -n "$ext_net_id" ]]; then
ext_net_id=$(openstack --os-cloud=devstack-admin \
--os-region-name="$REGION_NAME" network list \
--os-region-name="$REGION_NAME" network list \
--external -f csv -c ID | tail -n +2 | tail -n 1)
fi