devstack: Adapt to lib/neutron

Partial-Bug: #1666990
Change-Id: I529ad1bf8e00a4437822b7fbb6c4d5aa7539dcbc
This commit is contained in:
YAMAMOTO Takashi 2017-06-16 15:54:57 +09:00
parent abf50ed666
commit 97bd51d06c
2 changed files with 35 additions and 11 deletions

View File

@ -43,12 +43,9 @@ function configure_dr_agent_scheduler_driver {
function dr_install { function dr_install {
setup_develop $NEUTRON_DYNAMIC_ROUTING_DIR 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 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 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 fi
} }
@ -62,7 +59,12 @@ function dr_generate_config_files {
} }
function dr_post_configure { 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 dr_generate_config_files
if is_protocol_enabled BGP; then if is_protocol_enabled BGP; then
configure_dr_agent_bgp_config configure_dr_agent_bgp_config
@ -85,8 +87,14 @@ function start_dr_agent {
fi fi
agent_process=$process$bgp_parameter agent_process=$process$bgp_parameter
if is_service_enabled q-dr-agent; then if is_neutron_legacy_enabled; then
run_process q-dr-agent "$agent_process" 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 fi
} }
@ -96,5 +104,9 @@ function start_dr_agent {
#This API will be called for unstack #This API will be called for unstack
function stop_dr_agent { 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
} }

View File

@ -27,13 +27,25 @@ DR_MODE=${DR_MODE:-allinone}
case $DR_MODE in case $DR_MODE in
allinone) 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) dr_plugin)
enable_service q-dr if is_neutron_legacy_enabled; then
enable_service q-dr
else
enable_service neutron-dr
fi
;; ;;
dr_agent) 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 esac