Skip to content

Commit 6d0dee0

Browse files
mykolafliat-grozovik
authored andcommitted
[intfstat] fix --delete fail when counters dump does not exist (sonic-net#752)
Signed-off-by: Mykola Faryma <[email protected]>
1 parent 72112b0 commit 6d0dee0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

scripts/intfstat

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ def main():
269269
cnstat_fqn_file = cnstat_dir + "/" + cnstat_file
270270

271271
if delete_all_stats:
272+
# There is nothing to delete
273+
if not os.path.isdir(cnstat_dir):
274+
sys.exit(0)
275+
272276
for file in os.listdir(cnstat_dir):
273277
os.remove(cnstat_dir + "/" + file)
274278

0 commit comments

Comments
 (0)