From f069acf9ee4ecb0532d55158c99356faa4ff6fc9 Mon Sep 17 00:00:00 2001 From: Jens Rosenboom Date: Fri, 24 Feb 2017 16:25:59 +0100 Subject: [PATCH] Make subnet pool names unique Using the same name for two different subnet pools means that one needs to reference them by their UUID. Choosing unique names will allow us to use the name to reference the pool later on. At the same time simplify the command used for pool creation by instructing OSC to only output the value that we are interested in. Change-Id: Idedcb6328925d44cdd0f415450ec4ebbc272401d --- lib/neutron_plugins/services/l3 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/neutron_plugins/services/l3 b/lib/neutron_plugins/services/l3 index e87a30cadb..381162693d 100644 --- a/lib/neutron_plugins/services/l3 +++ b/lib/neutron_plugins/services/l3 @@ -87,7 +87,8 @@ PUBLIC_SUBNET_NAME=${PUBLIC_SUBNET_NAME:-"public-subnet"} # Subnetpool defaults USE_SUBNETPOOL=${USE_SUBNETPOOL:-True} -SUBNETPOOL_NAME=${SUBNETPOOL_NAME:-"shared-default-subnetpool"} +SUBNETPOOL_NAME_V4=${SUBNETPOOL_NAME:-"shared-default-subnetpool-v4"} +SUBNETPOOL_NAME_V6=${SUBNETPOOL_NAME:-"shared-default-subnetpool-v6"} SUBNETPOOL_PREFIX_V4=${SUBNETPOOL_PREFIX_V4:-$IPV4_ADDRS_SAFE_TO_USE} SUBNETPOOL_PREFIX_V6=${SUBNETPOOL_PREFIX_V6:-$IPV6_ADDRS_SAFE_TO_USE} @@ -169,10 +170,10 @@ function create_neutron_initial_network { if is_networking_extension_supported "auto-allocated-topology"; then if [[ "$USE_SUBNETPOOL" == "True" ]]; then if [[ "$IP_VERSION" =~ 4.* ]]; then - 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) + SUBNETPOOL_V4_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet pool create $SUBNETPOOL_NAME_V4 --default-prefix-length $SUBNETPOOL_SIZE_V4 --pool-prefix $SUBNETPOOL_PREFIX_V4 --share --default -f value -c id) fi if [[ "$IP_VERSION" =~ .*6 ]]; then - 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) + SUBNETPOOL_V6_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" subnet pool create $SUBNETPOOL_NAME_V6 --default-prefix-length $SUBNETPOOL_SIZE_V6 --pool-prefix $SUBNETPOOL_PREFIX_V6 --share --default -f value -c id) fi fi fi