Skip to content

Commit

Permalink
Ignore the non-SAI records in sairedis.rec files (#245)
Browse files Browse the repository at this point in the history
Signed-off-by: IGordynskiy <[email protected]>
  • Loading branch information
IGordynskyi authored Dec 18, 2024
1 parent 2ffef6a commit d9c0a1b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion common/sai.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,10 @@ def apply_rec(self, fname):
for cnt, record in records.items():
print("#{}: {}".format(cnt, record))
rec = record[0]
if rec[1] and not rec[1].startswith("SAI_"):
print("Ignored line {}: {}".format(cnt, rec))
continue

if rec[0] == 'c':
attrs = []
if len(rec) > 2:
Expand Down Expand Up @@ -713,7 +717,7 @@ def apply_rec(self, fname):
# It's expected that the previous command has failed
assert status in [rec[1], "SAI_STATUS_SUCCESS"], f"Expected fail reason is {rec[1]}. Actual fail reason is {status}"
else:
print("Iggnored line {}: {}".format(cnt, rec))
print("Ignored line {}: {}".format(cnt, rec))

print("Current SAI objects: {}".format(self.rec2vid))

Expand Down

0 comments on commit d9c0a1b

Please sign in to comment.