Don't run periodic actions for StaticScheduler

We want bindings to be fully static when using the StaticScheduler, so
do not run the periodic actions in that scenario.

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I2d874ce7170cdf3d81940dbe64960247b244fe87
(cherry picked from commit acfcd04dd4)
changes/00/852500/2
Dr. Jens Harbott 10 months ago committed by Dr. Jens Harbott
parent 97853cbcb5
commit 6f1335a4b7

@ -69,10 +69,11 @@ class BgpDrAgentSchedulerDbMixin(bgp_dras_ext.BgpDrSchedulerPluginBase,
def add_periodic_dragent_status_check(self):
if self.bgp_drscheduler:
self.add_agent_status_check_worker(
self.remove_bgp_speaker_from_down_dragents)
self.add_agent_status_check_worker(
self.schedule_all_unscheduled_bgp_speakers)
if self.bgp_drscheduler.periodic_actions:
self.add_agent_status_check_worker(
self.remove_bgp_speaker_from_down_dragents)
self.add_agent_status_check_worker(
self.schedule_all_unscheduled_bgp_speakers)
else:
LOG.warning(_LW("Cannot schedule BgpSpeaker to DrAgent. "
"Reason: No scheduler registered."))

@ -128,6 +128,8 @@ class BgpDrAgentFilter(base_resource_filter.BaseResourceFilter):
class BgpDrAgentSchedulerBase(BgpDrAgentFilter):
periodic_actions = True
def _register_callbacks(self):
registry.subscribe(self.schedule_bgp_speaker_callback,
dr_resources.BGP_SPEAKER,
@ -223,6 +225,8 @@ class WeightScheduler(base_scheduler.BaseWeightScheduler,
class StaticScheduler(base_scheduler.BaseScheduler,
BgpDrAgentFilter):
periodic_actions = False
def schedule_all_unscheduled_bgp_speakers(self, context):
return True

Loading…
Cancel
Save