Skip to content

Commit 0121f20

Browse files
committed
[OVN] Set OVN bridge in Chassis_Private in OVN agent
The method ``MetadataAgent._update_chassis_private_config`` is called in the OVN metadata agent to update the corresponding Chassis_Private register; in this case, with the OVN bridge used (that by default is usually "br-int"). This call was missing from the OVN agent "metadata" extension, both in the initialization method and in the resync. Closes-Bug: #2112314 Change-Id: Ia22572d8953c3bade5bfd9950a2d83e050847d65 (cherry picked from commit 5cfc1d5)
1 parent b5a77ac commit 0121f20

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

neutron/agent/ovn/extensions/metadata.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def resync(self):
161161
Reload the configuration and sync the agent again.
162162
"""
163163
self.agent_api.load_config()
164+
self._update_chassis_private_config()
164165
self.agent_api.update_neutron_sb_cfg_key()
165166
self.sync()
166167

@@ -178,6 +179,7 @@ def start(self):
178179

179180
# Register the agent with its corresponding Chassis
180181
self.register_metadata_agent()
182+
self._update_chassis_private_config()
181183
self.agent_api.update_neutron_sb_cfg_key()
182184

183185
# Start the metadata server.

neutron/tests/functional/agent/ovn/agent/test_ovn_neutron_agent.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ def test_check_metadata_started(self):
135135
# Check the metadata extension is registered.
136136
chassis_id = uuid.UUID(self.chassis_name)
137137
agent_id = uuid.uuid5(chassis_id, 'metadata_agent')
138+
ext_ids = {ovn_const.OVN_AGENT_METADATA_ID_KEY: str(agent_id),
139+
ovn_const.OVN_AGENT_OVN_BRIDGE: 'br-int',
140+
ovn_const.OVN_AGENT_NEUTRON_SB_CFG_KEY: '0',
141+
}
138142
ch_private = self.sb_api.lookup('Chassis_Private', self.chassis_name)
139-
self.assertEqual(
140-
ch_private.external_ids[ovn_const.OVN_AGENT_METADATA_ID_KEY],
141-
str(agent_id))
143+
self.assertEqual(ext_ids, ch_private.external_ids)
142144

143145
# Check Unix proxy is running.
144146
metadata_extension = self.ovn_agent[METADATA_EXTENSION]

0 commit comments

Comments
 (0)