Replace Q_L3_ENABLED by is_service_enabled q-l3
This patch replaces Q_L3_ENABLED with is_service_enabled q-l3.
Both of them idicates wherever Neutron L3 agent is enabled or not.
Change-Id: I33f0f5a6174d1d170bc2ac1c2e3a096d88d17cc1
diff --git a/lib/neutron_plugins/services/l3 b/lib/neutron_plugins/services/l3
index 5ff8ea5..a5a6c81 100644
--- a/lib/neutron_plugins/services/l3
+++ b/lib/neutron_plugins/services/l3
@@ -23,11 +23,9 @@
Q_PUBLIC_VETH_EX=${Q_PUBLIC_VETH_EX:-veth-pub-ex}
Q_PUBLIC_VETH_INT=${Q_PUBLIC_VETH_INT:-veth-pub-int}
-# The next two variables are configured by plugin
+# The next variable is configured by plugin
# e.g. _configure_neutron_l3_agent or lib/neutron_plugins/*
#
-# The plugin supports L3.
-Q_L3_ENABLED=${Q_L3_ENABLED:-True}
# L3 routers exist per tenant
Q_L3_ROUTER_PER_TENANT=${Q_L3_ROUTER_PER_TENANT:-True}
@@ -90,7 +88,6 @@
}
function _configure_neutron_l3_agent {
- Q_L3_ENABLED=True
cp $NEUTRON_DIR/etc/l3_agent.ini.sample $Q_L3_CONF_FILE
@@ -180,7 +177,7 @@
AUTO_ALLOCATE_EXT=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" ext-list | grep 'auto-allocated-topology' | get_field 1)
SUBNETPOOL_EXT=$(neutron --os-cloud devstack-admin --os-region "$REGION_NAME" ext-list | grep 'subnet_allocation' | get_field 1)
- if [[ "$Q_L3_ENABLED" == "True" ]]; then
+ if is_service_enabled q-l3; then
# Create a router, and add the private subnet as one of its interfaces
if [[ "$Q_L3_ROUTER_PER_TENANT" == "True" ]]; then
# create a tenant-owned router.
@@ -362,7 +359,7 @@
}
function is_provider_network {
- if [ "$Q_USE_PROVIDER_NETWORKING" == "True" ] && [ "$Q_L3_ENABLED" == "False" ]; then
+ if [ "$Q_USE_PROVIDER_NETWORKING" == "True" ]; then
return 0
fi
return 1