Neutron: use "OSC show -f value -c id" instead of "OSC list + grep"

We should leverage server-side filtering.

Change-Id: I3deef791868769b0b7cfc405d73dff57458ca427
This commit is contained in:
Jordan Pittier 2016-11-04 13:32:39 +01:00
parent 1493bdeba2
commit d038b60e65
3 changed files with 3 additions and 4 deletions

View File

@ -156,7 +156,7 @@ function get_role_id {
function get_network_id {
local NETWORK_NAME="$1"
local NETWORK_ID
NETWORK_ID=`openstack network list | grep $NETWORK_NAME | awk '{print $2}'`
NETWORK_ID=`openstack network show -f value -c id $NETWORK_NAME`
echo $NETWORK_ID
}

View File

@ -242,8 +242,7 @@ 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
public_network_id=$(openstack network list | grep $PUBLIC_NETWORK_NAME | \
awk '{print $2}')
public_network_id=$(openstack network show -f value -c id $PUBLIC_NETWORK_NAME)
fi
iniset $TEMPEST_CONFIG DEFAULT use_syslog $SYSLOG

View File

@ -54,7 +54,7 @@ fi
REMAINING_ARGS="${@:2}"
# BUG: with duplicate network names, this fails pretty hard.
NET_ID=$(openstack network list | grep "$NET_NAME" | awk '{print $2}')
NET_ID=$(openstack network show -f value -c id "$NET_NAME")
PROBE_ID=$(neutron-debug probe-list -c id -c network_id | grep "$NET_ID" | awk '{print $2}' | head -n 1)
# This runs a command inside the specific netns