From c00df207eed1d4dec808824d8e9dcd238e7d4e08 Mon Sep 17 00:00:00 2001 From: Sirushti Murugesan Date: Wed, 7 Oct 2015 15:06:51 +0530 Subject: [PATCH] Add a more accurate expression for obtaining (IPV6_)ROUTER_GW_IP neutron port-list returns a dictionary that's of random order in python 3. This expression sometimes returns a NULL value thus failing devstack. Add an expression that always returns a consistent ROUTER_GW_IP. Change-Id: Id23d9afda275051ca68bcba2dfd1b6e30f02c628 --- lib/neutron-legacy | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/neutron-legacy b/lib/neutron-legacy index c244e5470a..a74da2ccb7 100644 --- a/lib/neutron-legacy +++ b/lib/neutron-legacy @@ -1318,7 +1318,7 @@ function _neutron_configure_router_v4 { sudo ip addr add $ext_gw_ip/$cidr_len dev $ext_gw_interface sudo ip link set $ext_gw_interface up fi - ROUTER_GW_IP=`neutron port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F '"' -v subnet_id=$PUB_SUBNET_ID '$4 == subnet_id { print $8; }'` + ROUTER_GW_IP=`neutron port-list -c fixed_ips -c device_owner | grep router_gateway | awk -F'ip_address' '{ print $2 }' | cut -f3 -d\" | tr '\n' ' '` die_if_not_set $LINENO ROUTER_GW_IP "Failure retrieving ROUTER_GW_IP" sudo ip route replace $FIXED_RANGE via $ROUTER_GW_IP fi @@ -1349,7 +1349,7 @@ function _neutron_configure_router_v6 { sudo sysctl -w net.ipv6.conf.all.forwarding=1 # Configure and enable public bridge # Override global IPV6_ROUTER_GW_IP with the true value from neutron - IPV6_ROUTER_GW_IP=`neutron port-list -c fixed_ips | grep $ipv6_pub_subnet_id | awk -F '"' -v subnet_id=$ipv6_pub_subnet_id '$4 == subnet_id { print $8; }'` + IPV6_ROUTER_GW_IP=`neutron port-list -c fixed_ips | grep $ipv6_pub_subnet_id | awk -F'ip_address' '{ print $2 }' | cut -f3 -d\" | tr '\n' ' '` die_if_not_set $LINENO IPV6_ROUTER_GW_IP "Failure retrieving IPV6_ROUTER_GW_IP" if is_neutron_ovs_base_plugin; then