Move topics definitions to our own module for now

Partial-Bug: #1501793
Change-Id: I4d6bd79f52e16309e1f785c9afc78b4baff3256e
This commit is contained in:
YAMAMOTO Takashi 2015-10-02 02:01:15 +09:00
parent a5fcedf202
commit fe4e5cdcfa
7 changed files with 22 additions and 71 deletions

View File

@ -52,14 +52,6 @@ if [ "$COMMAND" = "install_plugin" ] || [ "$COMMAND" = "install_agent" ]; then
exit 1
fi
cp ./neutron_taas/neutron_dependencies/topics.py $DEVSTACK_PATH/neutron/common/topics.py
if [ $? = 0 ]; then
echo "Copied the common/topics.py file...."
else
echo "Install failed while copying topics.py file"
exit 1
fi
# patch the neutron.conf file to support TaaS plugin
./neutron_taas/neutron_dependencies/patch_conf_file.sh ./neutron_taas/neutron_dependencies/taas.conf /etc/neutron/neutron.conf
if [ $? = 0 ]; then

View File

View File

@ -0,0 +1,19 @@
# Copyright (C) 2015 Midokura SARL.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
# TODO(yamamoto): Move these to neutron.common.topics
TAAS_PLUGIN = 'n-taas-plugin'
TAAS_AGENT = 'n-taas_agent'

View File

@ -1,60 +0,0 @@
# Copyright (c) 2012 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied.
# See the License for the specific language governing permissions and
# limitations under the License.
NETWORK = 'network'
SUBNET = 'subnet'
PORT = 'port'
SECURITY_GROUP = 'security_group'
L2POPULATION = 'l2population'
DVR = 'dvr'
CREATE = 'create'
DELETE = 'delete'
UPDATE = 'update'
AGENT = 'q-agent-notifier'
PLUGIN = 'q-plugin'
L3PLUGIN = 'q-l3-plugin'
DHCP = 'q-dhcp-notifer'
FIREWALL_PLUGIN = 'q-firewall-plugin'
METERING_PLUGIN = 'q-metering-plugin'
LOADBALANCER_PLUGIN = 'n-lbaas-plugin'
TAAS_PLUGIN = 'n-taas-plugin'
L3_AGENT = 'l3_agent'
DHCP_AGENT = 'dhcp_agent'
METERING_AGENT = 'metering_agent'
LOADBALANCER_AGENT = 'n-lbaas_agent'
TAAS_AGENT = 'n-taas_agent'
def get_topic_name(prefix, table, operation, host=None):
"""Create a topic name.
The topic name needs to be synced between the agent and the
plugin. The plugin will send a fanout message to all of the
listening agents so that the agents in turn can perform their
updates accordingly.
:param prefix: Common prefix for the plugin/agent message queues.
:param table: The table in question (NETWORK, SUBNET, PORT).
:param operation: The operation that invokes notification (CREATE,
DELETE, UPDATE)
:param host: Add host to the topic
:returns: The topic name.
"""
if host:
return '%s-%s-%s.%s' % (prefix, table, operation, host)
return '%s-%s-%s' % (prefix, table, operation)

View File

@ -24,7 +24,7 @@ from oslo_service import service
from neutron.agent.common import config
from neutron.common import config as common_config
from neutron.common import rpc as n_rpc
from neutron.common import topics
from neutron_taas.common import topics
from neutron_taas.services.taas.agents.ovs import taas_ovs_agent

View File

@ -15,7 +15,7 @@
from neutron.agent.common import config
from neutron.common import topics
from neutron_taas.common import topics
from neutron_taas.services.taas.agents import taas_agent_api as api
from oslo_config import cfg

View File

@ -18,7 +18,7 @@ from oslo_config import cfg
import oslo_messaging as messaging
from neutron.common import rpc as n_rpc
from neutron.common import topics
from neutron_taas.common import topics
from neutron_taas.db import taas_db
from neutron_taas.extensions import taas as taas_ex
from oslo_log import log as logging