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
This commit is contained in:
Hynek Mlnarik 2016-03-24 16:22:17 +01:00
parent 419d44c0d6
commit 99915fa76b
3 changed files with 12 additions and 12 deletions

View File

@ -1148,9 +1148,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

@ -1091,11 +1091,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("int_ofport",
@ -1169,11 +1169,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("int_ofport",

View File

@ -203,13 +203,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 = [