From 38feb491ddf111a0f41a73ef08f51fbaf518c1bc Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Tue, 2 May 2017 13:49:34 +0900 Subject: [PATCH] devstack: Add neutron-sriov-agent alias for lib/neutron Change-Id: Id6f7cf1d859f4884aae5cbb950c91e136f5be669 --- devstack/lib/l2_agent_sriovnicswitch | 16 ++++++++++++++-- devstack/plugin.sh | 6 +++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/devstack/lib/l2_agent_sriovnicswitch b/devstack/lib/l2_agent_sriovnicswitch index f6cc63f91dc..41f6aeac171 100755 --- a/devstack/lib/l2_agent_sriovnicswitch +++ b/devstack/lib/l2_agent_sriovnicswitch @@ -15,9 +15,21 @@ function configure_l2_agent_sriovnicswitch { } function start_l2_agent_sriov { - run_process q-sriov-agt "$SRIOV_AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$SRIOV_AGENT_CONF" + local SERVICE_NAME + if is_neutron_legacy_enabled; then + SERVICE_NAME=q-sriov-agt + else + SERVICE_NAME=neutron-sriov-agent + fi + run_process $SERVICE_NAME "$SRIOV_AGENT_BINARY --config-file $NEUTRON_CONF --config-file /$SRIOV_AGENT_CONF" } function stop_l2_agent_sriov { - stop_process q-sriov-agt + local SERVICE_NAME + if is_neutron_legacy_enabled; then + SERVICE_NAME=q-sriov-agt + else + SERVICE_NAME=neutron-sriov-agent + fi + stop_process $SERVICE_NAME } diff --git a/devstack/plugin.sh b/devstack/plugin.sh index fe175314863..cfa8097bdf7 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -49,20 +49,20 @@ if [[ "$1" == "stack" ]]; then #Currently devstack lacks the option to run two agents on the same node. #Therefore we create new service, q-sriov-agt, and the # q-agt/neutron-agent should be OVS or linux bridge. - if is_service_enabled q-sriov-agt; then + if is_service_enabled q-sriov-agt neutron-sriov-agent; then configure_$NEUTRON_CORE_PLUGIN configure_l2_agent configure_l2_agent_sriovnicswitch fi ;; extra) - if is_service_enabled q-sriov-agt; then + if is_service_enabled q-sriov-agt neutron-sriov-agent; then start_l2_agent_sriov fi ;; esac elif [[ "$1" == "unstack" ]]; then - if is_service_enabled q-sriov-agt; then + if is_service_enabled q-sriov-agt neutron-sriov-agent; then stop_l2_agent_sriov fi fi