
The linuxbridge, openvswitch, and hyperv plugins all use the same basic RPC interface between their plugins and L2 agents. But the attributes describing a virtual network passed from the plugin to the agent over this interface differed for historical reasons. The openvswitch and hyperv plugins each pass network_type, physical_network, and segmentation_id attributes, whereas the linuxbridge plugin previously passed vlan_id and physical_network attributes, using special vlan_id values to indicate flat or local network types. This patch changes the linuxbridge plugin to pass network_type and segmentation_id attributes instead of the vlan_id attribute, bringing its message formats into sync with the other plugins. RPC compatibility is required for blueprint modular-l2 so that the ml2 plugin can work with all three existing types of L2 agent. This RPC message format change is also required for blueprint vxlan-linuxbridge. Unlike the vxlan-linuxbridge patch on which it is based (see https://review.openstack.org/#/c/26516/), this patch does not bump the linuxbridge RPC version number, as the ml2 plugin will require all three L2 agents to use the same RPC version. Instead, the updated linuxbridge agent maintains compatibility with old linuxbridge plugins by accepting either the old or new attributes. There is also a configuration option, currently turned on by default, to enable the updated linuxbridge plugin to pass the vlan_id attribute expected by old linuxbridge agents along with the new attributes. These message format compatibility mechanisms are intended to aid during upgrades, and can eventually be removed. Change-Id: I7cc1c9f96b09db6bab2c7d9f2b30b79fa4dab919
38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
# 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.
|
|
|
|
from oslo.config import cfg
|
|
|
|
from quantum.plugins.linuxbridge.common import config # noqa
|
|
from quantum.tests import base
|
|
|
|
|
|
class ConfigurationTest(base.BaseTestCase):
|
|
|
|
def test_defaults(self):
|
|
self.assertEqual(2,
|
|
cfg.CONF.AGENT.polling_interval)
|
|
self.assertEqual(True,
|
|
cfg.CONF.AGENT.rpc_support_old_agents)
|
|
self.assertEqual('sudo',
|
|
cfg.CONF.AGENT.root_helper)
|
|
self.assertEqual('local',
|
|
cfg.CONF.VLANS.tenant_network_type)
|
|
self.assertEqual(0,
|
|
len(cfg.CONF.VLANS.network_vlan_ranges))
|
|
self.assertEqual(0,
|
|
len(cfg.CONF.LINUX_BRIDGE.
|
|
physical_interface_mappings))
|