Skip to content

Commit d038b60

Browse files
author
Jordan Pittier
committed
Neutron: use "OSC show -f value -c id" instead of "OSC list + grep"
We should leverage server-side filtering. Change-Id: I3deef791868769b0b7cfc405d73dff57458ca427
1 parent 1493bde commit d038b60

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

exercises/neutron-adv-test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ function get_role_id {
156156
function get_network_id {
157157
local NETWORK_NAME="$1"
158158
local NETWORK_ID
159-
NETWORK_ID=`openstack network list | grep $NETWORK_NAME | awk '{print $2}'`
159+
NETWORK_ID=`openstack network show -f value -c id $NETWORK_NAME`
160160
echo $NETWORK_ID
161161
}
162162

lib/tempest

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ function configure_tempest {
242242
# the public network (for floating ip access) is only available
243243
# if the extension is enabled.
244244
if is_networking_extension_supported 'external-net'; then
245-
public_network_id=$(openstack network list | grep $PUBLIC_NETWORK_NAME | \
246-
awk '{print $2}')
245+
public_network_id=$(openstack network show -f value -c id $PUBLIC_NETWORK_NAME)
247246
fi
248247

249248
iniset $TEMPEST_CONFIG DEFAULT use_syslog $SYSLOG

tools/ping_neutron.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fi
5454
REMAINING_ARGS="${@:2}"
5555

5656
# BUG: with duplicate network names, this fails pretty hard.
57-
NET_ID=$(openstack network list | grep "$NET_NAME" | awk '{print $2}')
57+
NET_ID=$(openstack network show -f value -c id "$NET_NAME")
5858
PROBE_ID=$(neutron-debug probe-list -c id -c network_id | grep "$NET_ID" | awk '{print $2}' | head -n 1)
5959

6060
# This runs a command inside the specific netns

0 commit comments

Comments
 (0)