Skip to content

Commit

Permalink
python: ovsdb-idl: Add after_clear hook.
Browse files Browse the repository at this point in the history
This hook can be used by libaries to restore previous indexes after a
clear.

Signed-off-by: Max Lamprecht <[email protected]>
Signed-off-by: 0-day Robot <[email protected]>
  • Loading branch information
Max Lamprecht authored and ovsrobot committed Feb 13, 2025
1 parent 4baddff commit 6d91a41
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/ovs/db/idl.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,6 +790,9 @@ def cooperative_yield(self):
to doing nothing to avoid overhead where it is not needed.
"""

def after_clear(self):
"""Hook that can be used to restore indexes after a clear."""

def __clear(self):
changed = False

Expand All @@ -802,6 +805,7 @@ def __clear(self):

if changed:
self.change_seqno += 1
self.after_clear()

def __update_has_lock(self, new_has_lock):
if new_has_lock and not self.has_lock:
Expand Down

0 comments on commit 6d91a41

Please sign in to comment.