diff --git a/exercises/neutron-adv-test.sh b/exercises/neutron-adv-test.sh index bfd45eca5c..e8c8f62140 100755 --- a/exercises/neutron-adv-test.sh +++ b/exercises/neutron-adv-test.sh @@ -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 } diff --git a/lib/tempest b/lib/tempest index 201dc01a21..a5dd531a94 100644 --- a/lib/tempest +++ b/lib/tempest @@ -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 diff --git a/tools/ping_neutron.sh b/tools/ping_neutron.sh index c75575406a..73fe3f3bdf 100755 --- a/tools/ping_neutron.sh +++ b/tools/ping_neutron.sh @@ -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