Skip to content

Commit 4f11ff3

Browse files
Adopt openstack client for neutron commands
The neutron client is going to be deprecated during the Ocata timeframe, so it is time to start switching to the openstack client to invoke networking commands. use of neutron client in neutron-legacy has been left as is. The command for setting the router gateway is left as follow up. Change-Id: I0a63e03d7d4a08ad6c27f2729fc298322baab397
1 parent e0fdcd5 commit 4f11ff3

File tree

5 files changed

+51
-53
lines changed

5 files changed

+51
-53
lines changed

doc/source/guides/devstack-with-lbaas-v2.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ Run stack.sh and do some sanity checks
6666
./stack.sh
6767
. ./openrc
6868

69-
neutron net-list # should show public and private networks
69+
openstack network list # should show public and private networks
7070

7171
Create two nova instances that we can use as test http servers:
7272

7373
::
7474

7575
#create nova instances on private network
76-
nova boot --image $(nova image-list | awk '/ cirros-.*-x86_64-uec / {print $2}') --flavor 1 --nic net-id=$(neutron net-list | awk '/ private / {print $2}') node1
77-
nova boot --image $(nova image-list | awk '/ cirros-.*-x86_64-uec / {print $2}') --flavor 1 --nic net-id=$(neutron net-list | awk '/ private / {print $2}') node2
76+
nova boot --image $(nova image-list | awk '/ cirros-.*-x86_64-uec / {print $2}') --flavor 1 --nic net-id=$(openstack network list | awk '/ private / {print $2}') node1
77+
nova boot --image $(nova image-list | awk '/ cirros-.*-x86_64-uec / {print $2}') --flavor 1 --nic net-id=$(openstack network list | awk '/ private / {print $2}') node2
7878
nova list # should show the nova instances just created
7979

8080
#add secgroup rules to allow ssh etc..
81-
neutron security-group-rule-create default --protocol icmp
82-
neutron security-group-rule-create default --protocol tcp --port-range-min 22 --port-range-max 22
83-
neutron security-group-rule-create default --protocol tcp --port-range-min 80 --port-range-max 80
81+
openstack security group rule create default --protocol icmp
82+
openstack security group rule create default --protocol tcp --dst-port 22:22
83+
openstack security group rule create default --protocol tcp --dst-port 80:80
8484

8585
Set up a simple web server on each of these instances. ssh into each instance (username 'cirros', password 'cubswin:)') and run
8686

exercises/neutron-adv-test.sh

Lines changed: 6 additions & 6 deletions
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=`neutron net-list -F id -- --name=$NETWORK_NAME | awk "NR==4" | awk '{print $2}'`
159+
NETWORK_ID=`openstack network list | grep $NETWORK_NAME | awk '{print $2}'`
160160
echo $NETWORK_ID
161161
}
162162

@@ -234,9 +234,9 @@ function create_network {
234234
PROJECT_ID=$(get_project_id $PROJECT)
235235
source $TOP_DIR/openrc $PROJECT $PROJECT
236236
local NET_ID
237-
NET_ID=$(neutron net-create --project-id $PROJECT_ID $NET_NAME $EXTRA| grep ' id ' | awk '{print $4}' )
237+
NET_ID=$(openstack network create --project $PROJECT_ID $NET_NAME $EXTRA| grep ' id ' | awk '{print $4}' )
238238
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PROJECT_ID $NET_NAME $EXTRA"
239-
neutron subnet-create --ip-version 4 --project-id $PROJECT_ID --gateway $GATEWAY --subnetpool None $NET_ID $CIDR
239+
openstack subnet create --ip-version 4 --project $PROJECT_ID --gateway $GATEWAY --subnet-pool None --network $NET_ID --subnet-range $CIDR "${NET_NAME}_subnet"
240240
neutron_debug_admin probe-create --device-owner compute $NET_ID
241241
source $TOP_DIR/openrc demo demo
242242
}
@@ -325,10 +325,10 @@ function delete_network {
325325
PROJECT_ID=$(get_project_id $PROJECT)
326326
#TODO(nati) comment out until l3-agent merged
327327
#for res in port subnet net router;do
328-
for net_id in `neutron net-list -c id -c name | grep $NET_NAME | awk '{print $2}'`;do
328+
for net_id in `openstack network list -c ID -c Name | grep $NET_NAME | awk '{print $2}'`;do
329329
delete_probe $net_id
330-
neutron subnet-list | grep $net_id | awk '{print $2}' | xargs -I% neutron subnet-delete %
331-
neutron net-delete $net_id
330+
openstack subnet list | grep $net_id | awk '{print $2}' | xargs -I% openstack subnet delete %
331+
openstack network delete $net_id
332332
done
333333
source $TOP_DIR/openrc demo demo
334334
}

lib/neutron_plugins/services/l3

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -174,25 +174,25 @@ function create_neutron_initial_network {
174174
if is_networking_extension_supported "auto-allocated-topology"; then
175175
if [[ "$USE_SUBNETPOOL" == "True" ]]; then
176176
if [[ "$IP_VERSION" =~ 4.* ]]; then
177-
SUBNETPOOL_V4_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnetpool-create $SUBNETPOOL_NAME --default-prefixlen $SUBNETPOOL_SIZE_V4 --pool-prefix $SUBNETPOOL_PREFIX_V4 --shared --is-default=True | grep ' id ' | get_field 2)
177+
SUBNETPOOL_V4_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet pool create $SUBNETPOOL_NAME --default-prefix-length $SUBNETPOOL_SIZE_V4 --pool-prefix $SUBNETPOOL_PREFIX_V4 --share --default | grep ' id ' | get_field 2)
178178
fi
179179
if [[ "$IP_VERSION" =~ .*6 ]]; then
180-
SUBNETPOOL_V6_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnetpool-create $SUBNETPOOL_NAME --default-prefixlen $SUBNETPOOL_SIZE_V6 --pool-prefix $SUBNETPOOL_PREFIX_V6 --shared --is-default=True | grep ' id ' | get_field 2)
180+
SUBNETPOOL_V6_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet pool create $SUBNETPOOL_NAME --default-prefix-length $SUBNETPOOL_SIZE_V6 --pool-prefix $SUBNETPOOL_PREFIX_V6 --share --default | grep ' id ' | get_field 2)
181181
fi
182182
fi
183183
fi
184184

185185
if is_provider_network; then
186186
die_if_not_set $LINENO PHYSICAL_NETWORK "You must specify the PHYSICAL_NETWORK"
187187
die_if_not_set $LINENO PROVIDER_NETWORK_TYPE "You must specify the PROVIDER_NETWORK_TYPE"
188-
NET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" net-create $PHYSICAL_NETWORK --tenant_id $project_id --provider:network_type $PROVIDER_NETWORK_TYPE --provider:physical_network "$PHYSICAL_NETWORK" ${SEGMENTATION_ID:+--provider:segmentation_id $SEGMENTATION_ID} --shared | grep ' id ' | get_field 2)
188+
NET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" network create $PHYSICAL_NETWORK --project $project_id --provider-network-type $PROVIDER_NETWORK_TYPE --provider-physical-network "$PHYSICAL_NETWORK" ${SEGMENTATION_ID:+--provider-segment $SEGMENTATION_ID} --share | grep ' id ' | get_field 2)
189189
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PHYSICAL_NETWORK $project_id"
190190

191191
if [[ "$IP_VERSION" =~ 4.* ]]; then
192192
if [ -z $SUBNETPOOL_V4_ID ]; then
193193
fixed_range_v4=$FIXED_RANGE
194194
fi
195-
SUBNET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create --tenant_id $project_id --ip_version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} --name $PROVIDER_SUBNET_NAME --gateway $NETWORK_GATEWAY ${SUBNETPOOL_V4_ID:+--subnetpool $SUBNETPOOL_V4_ID} $NET_ID $fixed_range_v4 | grep ' id ' | get_field 2)
195+
SUBNET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet create --project $project_id --ip-version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} $PROVIDER_SUBNET_NAME --gateway $NETWORK_GATEWAY ${SUBNETPOOL_V4_ID:+--subnet-pool $SUBNETPOOL_V4_ID} --network $NET_ID --subnet-range $fixed_range_v4 | grep ' id ' | get_field 2)
196196
die_if_not_set $LINENO SUBNET_ID "Failure creating SUBNET_ID for $PROVIDER_SUBNET_NAME $project_id"
197197
fi
198198

@@ -202,7 +202,7 @@ function create_neutron_initial_network {
202202
if [ -z $SUBNETPOOL_V6_ID ]; then
203203
fixed_range_v6=$IPV6_PROVIDER_FIXED_RANGE
204204
fi
205-
SUBNET_V6_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create --tenant_id $project_id --ip_version 6 --ipv6-address-mode $IPV6_ADDRESS_MODE --gateway $IPV6_PROVIDER_NETWORK_GATEWAY --name $IPV6_PROVIDER_SUBNET_NAME ${SUBNETPOOL_V6_ID:+--subnetpool $SUBNETPOOL_V6_ID} $NET_ID $fixed_range_v6 | grep 'id' | get_field 2)
205+
SUBNET_V6_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet create --project $project_id --ip-version 6 --ipv6-address-mode $IPV6_ADDRESS_MODE --gateway $IPV6_PROVIDER_NETWORK_GATEWAY $IPV6_PROVIDER_SUBNET_NAME ${SUBNETPOOL_V6_ID:+--subnet-pool $SUBNETPOOL_V6_ID} --network $NET_ID $fixed_range_v6 | grep 'id' | get_field 2)
206206
die_if_not_set $LINENO SUBNET_V6_ID "Failure creating SUBNET_V6_ID for $IPV6_PROVIDER_SUBNET_NAME $project_id"
207207
fi
208208

@@ -212,7 +212,7 @@ function create_neutron_initial_network {
212212
sudo ip link set $PUBLIC_INTERFACE up
213213
fi
214214
else
215-
NET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" net-create --tenant-id $project_id "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
215+
NET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" network create --project $project_id "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
216216
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PRIVATE_NETWORK_NAME $project_id"
217217

218218
if [[ "$IP_VERSION" =~ 4.* ]]; then
@@ -230,23 +230,23 @@ function create_neutron_initial_network {
230230
# Create a router, and add the private subnet as one of its interfaces
231231
if [[ "$Q_L3_ROUTER_PER_TENANT" == "True" ]]; then
232232
# create a tenant-owned router.
233-
ROUTER_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-create --tenant-id $project_id $Q_ROUTER_NAME | grep ' id ' | get_field 2)
233+
ROUTER_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" router create --project $project_id $Q_ROUTER_NAME | grep ' id ' | get_field 2)
234234
die_if_not_set $LINENO ROUTER_ID "Failure creating ROUTER_ID for $project_id $Q_ROUTER_NAME"
235235
else
236236
# Plugin only supports creating a single router, which should be admin owned.
237-
ROUTER_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
237+
ROUTER_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" router create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
238238
die_if_not_set $LINENO ROUTER_ID "Failure creating ROUTER_ID for $Q_ROUTER_NAME"
239239
fi
240240

241-
EXTERNAL_NETWORK_FLAGS="--router:external"
241+
EXTERNAL_NETWORK_FLAGS="--external"
242242
if is_networking_extension_supported "auto-allocated-topology"; then
243-
EXTERNAL_NETWORK_FLAGS="$EXTERNAL_NETWORK_FLAGS --is-default"
243+
EXTERNAL_NETWORK_FLAGS="$EXTERNAL_NETWORK_FLAGS --default"
244244
fi
245245
# Create an external network, and a subnet. Configure the external network as router gw
246246
if [ "$Q_USE_PROVIDERNET_FOR_PUBLIC" = "True" ]; then
247-
EXT_NET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" net-create "$PUBLIC_NETWORK_NAME" -- $EXTERNAL_NETWORK_FLAGS --provider:network_type=flat --provider:physical_network=${PUBLIC_PHYSICAL_NETWORK} | grep ' id ' | get_field 2)
247+
EXT_NET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" network create "$PUBLIC_NETWORK_NAME" $EXTERNAL_NETWORK_FLAGS --provider-network-type flat --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} | grep ' id ' | get_field 2)
248248
else
249-
EXT_NET_ID=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" net-create "$PUBLIC_NETWORK_NAME" -- $EXTERNAL_NETWORK_FLAGS | grep ' id ' | get_field 2)
249+
EXT_NET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" network create "$PUBLIC_NETWORK_NAME" $EXTERNAL_NETWORK_FLAGS | grep ' id ' | get_field 2)
250250
fi
251251
die_if_not_set $LINENO EXT_NET_ID "Failure creating EXT_NET_ID for $PUBLIC_NETWORK_NAME"
252252

@@ -268,16 +268,16 @@ function _neutron_create_private_subnet_v4 {
268268
if [ -z $SUBNETPOOL_V4_ID ]; then
269269
fixed_range_v4=$FIXED_RANGE
270270
fi
271-
local subnet_params="--tenant-id $project_id "
272-
subnet_params+="--ip_version 4 "
271+
local subnet_params="--project $project_id "
272+
subnet_params+="--ip-version 4 "
273273
if [[ -n "$NETWORK_GATEWAY" ]]; then
274274
subnet_params+="--gateway $NETWORK_GATEWAY "
275275
fi
276-
subnet_params+="--name $PRIVATE_SUBNET_NAME "
277-
subnet_params+="${SUBNETPOOL_V4_ID:+--subnetpool $SUBNETPOOL_V4_ID} "
278-
subnet_params+="$NET_ID $fixed_range_v4"
276+
subnet_params+="${SUBNETPOOL_V4_ID:+--subnet-pool $SUBNETPOOL_V4_ID} "
277+
subnet_params+="${fixed_range_v4:+--subnet-range $fixed_range_v4} "
278+
subnet_params+="--network $NET_ID $PRIVATE_SUBNET_NAME"
279279
local subnet_id
280-
subnet_id=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create $subnet_params | grep ' id ' | get_field 2)
280+
subnet_id=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet create $subnet_params | grep ' id ' | get_field 2)
281281
die_if_not_set $LINENO subnet_id "Failure creating private IPv4 subnet for $project_id"
282282
echo $subnet_id
283283
}
@@ -291,52 +291,50 @@ function _neutron_create_private_subnet_v6 {
291291
if [ -z $SUBNETPOOL_V6_ID ]; then
292292
fixed_range_v6=$FIXED_RANGE_V6
293293
fi
294-
local subnet_params="--tenant-id $project_id "
295-
subnet_params+="--ip_version 6 "
294+
local subnet_params="--project $project_id "
295+
subnet_params+="--ip-version 6 "
296296
if [[ -n "$IPV6_PRIVATE_NETWORK_GATEWAY" ]]; then
297297
subnet_params+="--gateway $IPV6_PRIVATE_NETWORK_GATEWAY "
298298
fi
299-
subnet_params+="--name $IPV6_PRIVATE_SUBNET_NAME "
300-
subnet_params+="${SUBNETPOOL_V6_ID:+--subnetpool $SUBNETPOOL_V6_ID} "
301-
subnet_params+="$NET_ID $fixed_range_v6 $ipv6_modes"
299+
subnet_params+="${SUBNETPOOL_V6_ID:+--subnet-pool $SUBNETPOOL_V6_ID} "
300+
subnet_params+="${fixed_range_v6:+--subnet-range $fixed_range_v6 $ipv6_modes} "
301+
subnet_params+="--network $NET_ID $IPV6_PRIVATE_SUBNET_NAME "
302302
local ipv6_subnet_id
303-
ipv6_subnet_id=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create $subnet_params | grep ' id ' | get_field 2)
303+
ipv6_subnet_id=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet create $subnet_params | grep ' id ' | get_field 2)
304304
die_if_not_set $LINENO ipv6_subnet_id "Failure creating private IPv6 subnet for $project_id"
305305
echo $ipv6_subnet_id
306306
}
307307

308308
# Create public IPv4 subnet
309309
function _neutron_create_public_subnet_v4 {
310-
local subnet_params="--ip_version 4 "
310+
local subnet_params="--ip-version 4 "
311311
subnet_params+="${Q_FLOATING_ALLOCATION_POOL:+--allocation-pool $Q_FLOATING_ALLOCATION_POOL} "
312312
if [[ -n "$PUBLIC_NETWORK_GATEWAY" ]]; then
313313
subnet_params+="--gateway $PUBLIC_NETWORK_GATEWAY "
314314
fi
315-
subnet_params+="--name $PUBLIC_SUBNET_NAME "
316-
subnet_params+="$EXT_NET_ID $FLOATING_RANGE "
317-
subnet_params+="-- --enable_dhcp=False"
315+
subnet_params+="--network $EXT_NET_ID --subnet-range $FLOATING_RANGE --no-dhcp "
316+
subnet_params+="$PUBLIC_SUBNET_NAME"
318317
local id_and_ext_gw_ip
319-
id_and_ext_gw_ip=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create $subnet_params | grep -e 'gateway_ip' -e ' id ')
318+
id_and_ext_gw_ip=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet create $subnet_params | grep -e 'gateway_ip' -e ' id ')
320319
die_if_not_set $LINENO id_and_ext_gw_ip "Failure creating public IPv4 subnet"
321320
echo $id_and_ext_gw_ip
322321
}
323322

324323
# Create public IPv6 subnet
325324
function _neutron_create_public_subnet_v6 {
326-
local subnet_params="--ip_version 6 "
325+
local subnet_params="--ip-version 6 "
327326
subnet_params+="--gateway $IPV6_PUBLIC_NETWORK_GATEWAY "
328-
subnet_params+="--name $IPV6_PUBLIC_SUBNET_NAME "
329-
subnet_params+="$EXT_NET_ID $IPV6_PUBLIC_RANGE "
330-
subnet_params+="-- --enable_dhcp=False"
327+
subnet_params+="--network $EXT_NET_ID --subnet-range $IPV6_PUBLIC_RANGE --no-dhcp "
328+
subnet_params+="$IPV6_PUBLIC_SUBNET_NAME"
331329
local ipv6_id_and_ext_gw_ip
332-
ipv6_id_and_ext_gw_ip=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" subnet-create $subnet_params | grep -e 'gateway_ip' -e ' id ')
330+
ipv6_id_and_ext_gw_ip=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet create $subnet_params | grep -e 'gateway_ip' -e ' id ')
333331
die_if_not_set $LINENO ipv6_id_and_ext_gw_ip "Failure creating an IPv6 public subnet"
334332
echo $ipv6_id_and_ext_gw_ip
335333
}
336334

337335
# Configure neutron router for IPv4 public access
338336
function _neutron_configure_router_v4 {
339-
neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-interface-add $ROUTER_ID $SUBNET_ID
337+
openstack --os-cloud devstack-admin --os-region "$REGION_NAME" router add subnet $ROUTER_ID $SUBNET_ID
340338
# Create a public subnet on the external network
341339
local id_and_ext_gw_ip
342340
id_and_ext_gw_ip=$(_neutron_create_public_subnet_v4 $EXT_NET_ID)
@@ -371,7 +369,7 @@ function _neutron_configure_router_v4 {
371369
sudo ip addr add $ext_gw_ip/$cidr_len dev $ext_gw_interface
372370
sudo ip link set $ext_gw_interface up
373371
fi
374-
ROUTER_GW_IP=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F'ip_address' '{ print $2 }' | cut -f3 -d\" | tr '\n' ' ')
372+
ROUTER_GW_IP=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" port list -c 'Fixed IP Addresses' --device-owner network:router_gateway | awk -F'ip_address' '{ print $2 }' | cut -f2 -d\' | tr '\n' ' ')
375373
die_if_not_set $LINENO ROUTER_GW_IP "Failure retrieving ROUTER_GW_IP"
376374
local replace_range=${SUBNETPOOL_PREFIX_V4}
377375
if [[ -z "${SUBNETPOOL_V4_ID}" ]]; then
@@ -385,7 +383,7 @@ function _neutron_configure_router_v4 {
385383

386384
# Configure neutron router for IPv6 public access
387385
function _neutron_configure_router_v6 {
388-
neutron --os-cloud devstack-admin --os-region "$REGION_NAME" router-interface-add $ROUTER_ID $IPV6_SUBNET_ID
386+
openstack --os-cloud devstack-admin --os-region "$REGION_NAME" router add subnet $ROUTER_ID $IPV6_SUBNET_ID
389387
# Create a public subnet on the external network
390388
local ipv6_id_and_ext_gw_ip
391389
ipv6_id_and_ext_gw_ip=$(_neutron_create_public_subnet_v6 $EXT_NET_ID)
@@ -416,7 +414,7 @@ function _neutron_configure_router_v6 {
416414
sudo sysctl -w net.ipv6.conf.all.forwarding=1
417415
# Configure and enable public bridge
418416
# Override global IPV6_ROUTER_GW_IP with the true value from neutron
419-
IPV6_ROUTER_GW_IP=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" port-list -c fixed_ips | grep $ipv6_pub_subnet_id | awk -F'ip_address' '{ print $2 }' | cut -f3 -d\" | tr '\n' ' ')
417+
IPV6_ROUTER_GW_IP=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" port list -c 'Fixed IP Addresses' | grep $ipv6_pub_subnet_id | awk -F'ip_address' '{ print $2 }' | cut -f2 -d\' | tr '\n' ' ')
420418
die_if_not_set $LINENO IPV6_ROUTER_GW_IP "Failure retrieving IPV6_ROUTER_GW_IP"
421419

422420
if is_neutron_ovs_base_plugin; then
@@ -446,6 +444,6 @@ function is_provider_network {
446444
function is_networking_extension_supported {
447445
local extension=$1
448446
# TODO(sc68cal) cache this instead of calling every time
449-
EXT_LIST=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" ext-list -c alias -f value)
447+
EXT_LIST=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" extension list --network -c Alias -f value)
450448
[[ $EXT_LIST =~ $extension ]] && return 0
451449
}

lib/tempest

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +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=$(neutron net-list | grep $PUBLIC_NETWORK_NAME | \
245+
public_network_id=$(openstack network list | grep $PUBLIC_NETWORK_NAME | \
246246
awk '{print $2}')
247247
fi
248248

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=$(neutron net-list | grep "$NET_NAME" | awk '{print $2}')
57+
NET_ID=$(openstack network list | grep "$NET_NAME" | awk '{print $2}')
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)