Fix setting peer to bridge interfaces

OVSDB implementation refuses to set options:peer column value
 as there is no such column in the Interface table. The correct way
 is to set 'options' column value to a map containing key 'peer', as
 already used in ovs_lib.

Change-Id: Ib5e956f425b36f54cda017c91ac71d9d7ee9747c
Closes-Bug: 1528894
(cherry picked from commit d130245967)
This commit is contained in:
Hynek Mlnarik 2016-03-24 16:22:17 +01:00
parent 1962f5fc39
commit 0e543db4ff
3 changed files with 12 additions and 12 deletions

View File

@ -1169,9 +1169,9 @@ class OVSNeutronAgent(sg_rpc.SecurityGroupAgentRpcCallbackMixin,
else:
# associate patch ports to pass traffic
self.int_br.set_db_attribute('Interface', int_if_name,
'options:peer', phys_if_name)
'options', {'peer': phys_if_name})
br.set_db_attribute('Interface', phys_if_name,
'options:peer', int_if_name)
'options', {'peer': int_if_name})
def update_stale_ofport_rules(self):
# right now the ARP spoofing rules are the only thing that utilizes

View File

@ -858,11 +858,11 @@ class TestOvsNeutronAgent(object):
mock.call.int_br.drop_port(in_port='int_ofport'),
mock.call.phys_br.drop_port(in_port='phy_ofport'),
mock.call.int_br.set_db_attribute('Interface', 'int-br-eth',
'options:peer',
'phy-br-eth'),
'options',
{'peer': 'phy-br-eth'}),
mock.call.phys_br.set_db_attribute('Interface', 'phy-br-eth',
'options:peer',
'int-br-eth'),
'options',
{'peer': 'int-br-eth'}),
]
parent.assert_has_calls(expected_calls)
self.assertEqual(self.agent.int_ofports["physnet1"],
@ -935,11 +935,11 @@ class TestOvsNeutronAgent(object):
mock.call.int_br.drop_port(in_port='int_ofport'),
mock.call.phys_br.drop_port(in_port='phy_ofport'),
mock.call.int_br.set_db_attribute('Interface', 'int-br-eth',
'options:peer',
'phy-br-eth'),
'options',
{'peer': 'phy-br-eth'}),
mock.call.phys_br.set_db_attribute('Interface', 'phy-br-eth',
'options:peer',
'int-br-eth'),
'options',
{'peer': 'int-br-eth'}),
]
parent.assert_has_calls(expected_calls)
self.assertEqual(self.agent.int_ofports["physnet1"],

View File

@ -201,13 +201,13 @@ class TunnelTest(object):
mock.call.drop_port(in_port=self.MAP_TUN_INT_OFPORT),
mock.call.set_db_attribute(
'Interface', 'int-%s' % self.MAP_TUN_BRIDGE,
'options:peer', 'phy-%s' % self.MAP_TUN_BRIDGE),
'options', {'peer': 'phy-%s' % self.MAP_TUN_BRIDGE}),
]
self.mock_map_tun_bridge_expected += [
mock.call.drop_port(in_port=self.MAP_TUN_PHY_OFPORT),
mock.call.set_db_attribute(
'Interface', 'phy-%s' % self.MAP_TUN_BRIDGE,
'options:peer', 'int-%s' % self.MAP_TUN_BRIDGE),
'options', {'peer': 'int-%s' % self.MAP_TUN_BRIDGE}),
]
self.mock_tun_bridge_expected = [