Skip to content

Commit

Permalink
Removed double cleanup in apply_rec() (#214)
Browse files Browse the repository at this point in the history
Signed-off-by: Andriy Kokhan <[email protected]>
  • Loading branch information
andriy-kokhan authored Oct 13, 2023
1 parent 6800640 commit 0646acf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions common/sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,12 +214,6 @@ def process_commands(self, commands, cleanup=False):
def alloc_vid(self, obj_type):
return self.sai_client.alloc_vid(obj_type)

def apply_rec(self, fname):
dut = self.cfg.get("dut", None)
if dut:
dut.cleanup()
return self.__apply_rec(fname)

def cleanup(self):
dut = self.cfg.get("dut", None)
if dut:
Expand Down Expand Up @@ -503,9 +497,9 @@ def objects_discovery(self):
for idx, oid in enumerate(dot1q_bp_oids):
self.create_alias(f"BRIDGE_PORT_{idx}", 'SAI_OBJECT_TYPE_BRIDGE_PORT', oid)

def __apply_rec(self, fname):
def apply_rec(self, fname):
# Since it's expected that sairedis.rec file contains a full configuration,
# we must flush both Redis and NPU state before we start.
# before we start, we must flush both RPC backend (Redis or Thrift server) and NPU state.
self.cleanup()

oids = []
Expand Down

0 comments on commit 0646acf

Please sign in to comment.