Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
Cloud:OpenStack:Newton
openstack-neutron-doc
0001-DVR-Fix-mac-format-for-backward-compatibil...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-DVR-Fix-mac-format-for-backward-compatibility-with-v.patch of Package openstack-neutron-doc
From 77152ee76eb588aefc693472ceaa415559bdebf4 Mon Sep 17 00:00:00 2001 From: Swaminathan Vasudevan <SVasudevan@suse.com> Date: Wed, 14 Mar 2018 16:59:32 -0700 Subject: [PATCH] DVR: Fix mac format for backward compatibility with vsctl api Fix the mac address format for backward compatibility with vsctl ovs api Closes-Bug: #1756406 Change-Id: I3ba11fae433b437d9d3a0b12dd8a11fe1b35046a (cherry picked from commit 6b13cf0bee67e6196201e7863b1facce54b6d6f6) --- .../openvswitch/agent/ovs_dvr_neutron_agent.py | 17 ++++++++++++----- .../openvswitch/agent/test_ovs_neutron_agent.py | 8 ++++---- 2 files changed, 16 insertions(+), 9 deletions(-) Index: neutron-9.4.2.dev21/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py =================================================================== --- neutron-9.4.2.dev21.orig/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py +++ neutron-9.4.2.dev21/neutron/plugins/ml2/drivers/openvswitch/agent/ovs_dvr_neutron_agent.py @@ -15,6 +15,7 @@ import sys +import netaddr from neutron_lib import constants as n_const from oslo_config import cfg from oslo_log import log as logging @@ -199,7 +200,9 @@ class OVSDVRNeutronAgent(object): LOG.debug("L2 Agent DVR: Received response for " "get_dvr_mac_address_by_host() from " "plugin: %r", details) - self.dvr_mac_address = details['mac_address'] + self.dvr_mac_address = ( + netaddr.EUI(details['mac_address'], + dialect=netaddr.mac_unix_expanded)) return def setup_dvr_flows_on_integ_br(self): @@ -312,9 +315,11 @@ class OVSDVRNeutronAgent(object): dvr_macs = self.plugin_rpc.get_dvr_mac_address_list(self.context) LOG.debug("L2 Agent DVR: Received these MACs: %r", dvr_macs) for mac in dvr_macs: - if mac['mac_address'] == self.dvr_mac_address: + c_mac = netaddr.EUI(mac['mac_address'], + dialect=netaddr.mac_unix_expanded) + if c_mac == self.dvr_mac_address: continue - self._add_dvr_mac(mac['mac_address']) + self._add_dvr_mac(c_mac) def dvr_mac_address_update(self, dvr_macs): if not self.dvr_mac_address: @@ -324,9 +329,11 @@ class OVSDVRNeutronAgent(object): dvr_host_macs = set() for entry in dvr_macs: - if entry['mac_address'] == self.dvr_mac_address: + e_mac = netaddr.EUI(entry['mac_address'], + dialect=netaddr.mac_unix_expanded) + if e_mac == self.dvr_mac_address: continue - dvr_host_macs.add(entry['mac_address']) + dvr_host_macs.add(e_mac) if dvr_host_macs == self.registered_dvr_macs: LOG.debug("DVR Mac address already up to date") Index: neutron-9.4.2.dev21/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py =================================================================== --- neutron-9.4.2.dev21.orig/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py +++ neutron-9.4.2.dev21/neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_neutron_agent.py @@ -2999,9 +2999,9 @@ class TestOvsDvrNeutronAgent(object): mock.patch.object(self.agent.dvr_agent.plugin_rpc, 'get_dvr_mac_address_list', return_value=[{'host': 'cn1', - 'mac_address': 'aa:bb:cc:dd:ee:ff'}, + 'mac_address': 'aa-bb-cc-dd-ee-ff'}, {'host': 'cn2', - 'mac_address': '11:22:33:44:55:66'}]): + 'mac_address': '11-22-33-44-55-66'}]): self.agent.dvr_agent.setup_dvr_flows_on_integ_br() self.assertTrue(self.agent.dvr_agent.in_distributed_mode()) physical_networks = list( @@ -3029,7 +3029,7 @@ class TestOvsDvrNeutronAgent(object): with mock.patch.object(self.agent.dvr_agent.plugin_rpc, 'get_dvr_mac_address_by_host', return_value={'host': 'cn1', - 'mac_address': 'aa:22:33:44:55:66'}): + 'mac_address': 'aa-22-33-44-55-66'}): self.agent.dvr_agent.get_dvr_mac_address() self.assertEqual('aa:22:33:44:55:66', self.agent.dvr_agent.dvr_mac_address) @@ -3050,7 +3050,7 @@ class TestOvsDvrNeutronAgent(object): self.assertFalse(self.agent.dvr_agent.in_distributed_mode()) def test_get_dvr_mac_address_retried(self): - valid_entry = {'host': 'cn1', 'mac_address': 'aa:22:33:44:55:66'} + valid_entry = {'host': 'cn1', 'mac_address': 'aa-22-33-44-55-66'} raise_timeout = oslo_messaging.MessagingTimeout() # Raise a timeout the first 2 times it calls get_dvr_mac_address() self._setup_for_dvr_test()
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor