Fast exit if "segments" plugin is not loaded

The method ``auto_schedule_new_network_segments`` will be called when a
new agent is created and the segment host mapping is updated. If the
"segments" plugin is not loaded, the method
``auto_schedule_new_network_segments`` should fast exit.

Closes-Bug: #2102609
Change-Id: I46d58e1f7f9f6b0fdb70f2298839ee5423722e11
This commit is contained in:
Rodolfo Alonso Hernandez
2025-03-14 02:14:41 +00:00
parent e47aed1508
commit 98b006b7e0

View File

@@ -489,6 +489,9 @@ class DhcpAgentSchedulerDbMixin(dhcpagentscheduler
if not cfg.CONF.network_auto_schedule:
return
segment_plugin = directory.get_plugin('segments')
if not segment_plugin:
return
dhcp_notifier = self.agent_notifiers.get(constants.AGENT_TYPE_DHCP)
segment_ids = payload.metadata.get('current_segment_ids')
segments = segment_plugin.get_segments(