Skip to content

Commit

Permalink
Remove scheduled sequesters if timestamps in config are removed (#334)
Browse files Browse the repository at this point in the history
  • Loading branch information
henry54809 authored Jul 26, 2021
1 parent a6c78b5 commit 2dfb911
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions forch/port_state_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def handle_static_device_behavior(self, mac, device_behavior):
self._auto_sequester[mac_lower] = auto_sequester
if device_behavior.segment:
self.handle_device_behavior(mac_lower, device_behavior, static=True)
scheduled_sequester = self._scheduled_sequester_timer.get(mac_lower)
scheduled_sequester = self._scheduled_sequester_timer.pop(mac_lower, None)
if scheduled_sequester:
scheduled_sequester.cancel()
if device_behavior.scheduled_sequestering_timestamp:
if scheduled_sequester:
scheduled_sequester.cancel()
self._schedule_device_sequester(device_behavior, mac_lower)

def handle_device_behavior(self, mac, device_behavior, static=False):
Expand Down

0 comments on commit 2dfb911

Please sign in to comment.