From 97bd51d06ceddde7f00d6fe986d2fe2ce6f92eb8 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Fri, 16 Jun 2017 15:54:57 +0900 Subject: [PATCH] devstack: Adapt to lib/neutron Partial-Bug: #1666990 Change-Id: I529ad1bf8e00a4437822b7fbb6c4d5aa7539dcbc --- devstack/lib/dr | 28 ++++++++++++++++++++-------- devstack/settings | 18 +++++++++++++++--- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/devstack/lib/dr b/devstack/lib/dr index 1fa94584..b6f0dc08 100644 --- a/devstack/lib/dr +++ b/devstack/lib/dr @@ -43,12 +43,9 @@ function configure_dr_agent_scheduler_driver { function dr_install { setup_develop $NEUTRON_DYNAMIC_ROUTING_DIR - if is_service_enabled q-dr && is_service_enabled q-svc; then + if is_service_enabled q-dr neutron-dr && is_service_enabled q-svc neutron-api; then sudo install -d -o $STACK_USER $NEUTRON_CONF_DIR/policy.d cp -v $NEUTRON_DYNAMIC_ROUTING_DIR/etc/neutron/policy.d/dynamic_routing.conf $NEUTRON_CONF_DIR/policy.d - if is_protocol_enabled BGP; then - _neutron_service_plugin_class_add $BGP_PLUGIN - fi fi } @@ -62,7 +59,12 @@ function dr_generate_config_files { } function dr_post_configure { - if is_service_enabled q-dr-agent; then + if is_service_enabled q-dr neutron-dr && is_service_enabled q-svc neutron-api; then + if is_protocol_enabled BGP; then + neutron_service_plugin_class_add $BGP_PLUGIN + fi + fi + if is_service_enabled q-dr-agent neutron-dr-agent; then dr_generate_config_files if is_protocol_enabled BGP; then configure_dr_agent_bgp_config @@ -85,8 +87,14 @@ function start_dr_agent { fi agent_process=$process$bgp_parameter - if is_service_enabled q-dr-agent; then - run_process q-dr-agent "$agent_process" + if is_neutron_legacy_enabled; then + if is_service_enabled q-dr-agent; then + run_process q-dr-agent "$agent_process" + fi + else + if is_service_enabled neutron-dr-agent; then + run_process neutron-dr-agent "$agent_process" + fi fi } @@ -96,5 +104,9 @@ function start_dr_agent { #This API will be called for unstack function stop_dr_agent { - stop_process q-dr-agent + if is_neutron_legacy_enabled; then + stop_process q-dr-agent + else + stop_process neutron-dr-agent + fi } diff --git a/devstack/settings b/devstack/settings index ccbf6fc5..3a43204d 100644 --- a/devstack/settings +++ b/devstack/settings @@ -27,13 +27,25 @@ DR_MODE=${DR_MODE:-allinone} case $DR_MODE in allinone) - enable_service q-dr q-dr-agent + if is_neutron_legacy_enabled; then + enable_service q-dr q-dr-agent + else + enable_service neutron-dr neutron-dr-agent + fi ;; dr_plugin) - enable_service q-dr + if is_neutron_legacy_enabled; then + enable_service q-dr + else + enable_service neutron-dr + fi ;; dr_agent) - enable_service q-dr-agent + if is_neutron_legacy_enabled; then + enable_service q-dr-agent + else + enable_service neutron-dr-agent + fi ;; esac